public function InlineFragmentRendererTest::testExceptionInSubRequestsDoesNotMangleOutputBuffers in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-kernel/Tests/Fragment/InlineFragmentRendererTest.php \Symfony\Component\HttpKernel\Tests\Fragment\InlineFragmentRendererTest::testExceptionInSubRequestsDoesNotMangleOutputBuffers()
File
- vendor/
symfony/ http-kernel/ Tests/ Fragment/ InlineFragmentRendererTest.php, line 143
Class
Namespace
Symfony\Component\HttpKernel\Tests\FragmentCode
public function testExceptionInSubRequestsDoesNotMangleOutputBuffers() {
$resolver = $this
->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface');
$resolver
->expects($this
->once())
->method('getController')
->will($this
->returnValue(function () {
ob_start();
echo 'bar';
throw new \RuntimeException();
}));
$resolver
->expects($this
->once())
->method('getArguments')
->will($this
->returnValue(array()));
$kernel = new HttpKernel(new EventDispatcher(), $resolver);
$renderer = new InlineFragmentRenderer($kernel);
// simulate a main request with output buffering
ob_start();
echo 'Foo';
// simulate a sub-request with output buffering and an exception
$renderer
->render('/', Request::create('/'), array(
'ignore_errors' => true,
));
$this
->assertEquals('Foo', ob_get_clean());
}