Skip to content

Commit af4b404

Browse files
committed
fix merge
1 parent 7adba28 commit af4b404

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function testRenderExceptionIgnoreErrors()
102102

103103
public function testRenderExceptionIgnoreErrorsWithAlt()
104104
{
105-
$strategy = new InlineFragmentRenderer($this->getKernel($this->returnCallback(function () {
105+
$strategy = new InlineFragmentRenderer($this->getKernel(function () {
106106
static $firstCall = true;
107107

108108
if ($firstCall) {
@@ -112,7 +112,7 @@ public function testRenderExceptionIgnoreErrorsWithAlt()
112112
}
113113

114114
return new Response('bar');
115-
})));
115+
}));
116116

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

128128
if ($returnValue instanceof \Exception) {
129129
$mocker->willThrowException($returnValue);
130+
} elseif ($returnValue instanceof \Closure) {
131+
$mocker->willReturnCallback($returnValue);
130132
} else {
131133
$mocker->willReturn(...(\is_array($returnValue) ? $returnValue : [$returnValue]));
132134
}

0 commit comments

Comments
 (0)