public function HttpKernelTest::testHandleWhenTheControllerDoesNotReturnAResponseButAViewIsRegistered 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::testHandleWhenTheControllerDoesNotReturnAResponseButAViewIsRegistered()
File
- vendor/
symfony/ http-kernel/ Tests/ HttpKernelTest.php, line 220
Class
Namespace
Symfony\Component\HttpKernel\TestsCode
public function testHandleWhenTheControllerDoesNotReturnAResponseButAViewIsRegistered() {
$dispatcher = new EventDispatcher();
$dispatcher
->addListener(KernelEvents::VIEW, function ($event) {
$event
->setResponse(new Response($event
->getControllerResult()));
});
$kernel = new HttpKernel($dispatcher, $this
->getResolver(function () {
return 'foo';
}));
$this
->assertEquals('foo', $kernel
->handle(new Request())
->getContent());
}