Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed May 17, 2024
1 parent 7adba28 commit af4b404
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function testRenderExceptionIgnoreErrors()

public function testRenderExceptionIgnoreErrorsWithAlt()
{
$strategy = new InlineFragmentRenderer($this->getKernel($this->returnCallback(function () {
$strategy = new InlineFragmentRenderer($this->getKernel(function () {
static $firstCall = true;

if ($firstCall) {
Expand All @@ -112,7 +112,7 @@ public function testRenderExceptionIgnoreErrorsWithAlt()
}

return new Response('bar');
})));
}));

$this->assertEquals('bar', $strategy->render('/', Request::create('/'), ['ignore_errors' => true, 'alt' => '/foo'])->getContent());
}
Expand All @@ -127,6 +127,8 @@ private function getKernel($returnValue)

if ($returnValue instanceof \Exception) {
$mocker->willThrowException($returnValue);
} elseif ($returnValue instanceof \Closure) {
$mocker->willReturnCallback($returnValue);
} else {
$mocker->willReturn(...(\is_array($returnValue) ? $returnValue : [$returnValue]));
}
Expand Down

0 comments on commit af4b404

Please sign in to comment.