public function HttpKernelTest::testHandleWhenControllerThrowsAnExceptionAndCatchIsTrueWithANonHandlingListener in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/http-kernel/Tests/HttpKernelTest.php \Symfony\Component\HttpKernel\Tests\HttpKernelTest::testHandleWhenControllerThrowsAnExceptionAndCatchIsTrueWithANonHandlingListener()
File
- vendor/
symfony/ http-kernel/ Tests/ HttpKernelTest.php, line 60
Class
Namespace
Symfony\Component\HttpKernel\TestsCode
public function testHandleWhenControllerThrowsAnExceptionAndCatchIsTrueWithANonHandlingListener() {
$exception = new \RuntimeException();
$dispatcher = new EventDispatcher();
$dispatcher
->addListener(KernelEvents::EXCEPTION, function ($event) {
// should set a response, but does not
});
$kernel = new HttpKernel($dispatcher, $this
->getResolver(function () use ($exception) {
throw $exception;
}));
try {
$kernel
->handle(new Request(), HttpKernelInterface::MASTER_REQUEST, true);
$this
->fail('LogicException expected');
} catch (\RuntimeException $e) {
$this
->assertSame($exception, $e);
}
}