diff options
Diffstat (limited to 'vendor/symfony/http-kernel/Tests/HttpKernelTest.php')
| -rw-r--r-- | vendor/symfony/http-kernel/Tests/HttpKernelTest.php | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/vendor/symfony/http-kernel/Tests/HttpKernelTest.php b/vendor/symfony/http-kernel/Tests/HttpKernelTest.php index 4d1e267e3a..d1162f0431 100644 --- a/vendor/symfony/http-kernel/Tests/HttpKernelTest.php +++ b/vendor/symfony/http-kernel/Tests/HttpKernelTest.php @@ -20,8 +20,6 @@ use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface; use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; -use Symfony\Component\HttpKernel\Event\FilterControllerArgumentsEvent; -use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\HttpKernel\Exception\ControllerDoesNotReturnResponseException; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; @@ -128,7 +126,7 @@ class HttpKernelTest extends TestCase public function testHandleWhenAnExceptionIsHandledWithASpecificStatusCode($expectedStatusCode) { $dispatcher = new EventDispatcher(); - $dispatcher->addListener(KernelEvents::EXCEPTION, function (GetResponseForExceptionEvent $event) use ($expectedStatusCode) { + $dispatcher->addListener(KernelEvents::EXCEPTION, function ($event) use ($expectedStatusCode) { $event->allowCustomResponseCode(); $event->setResponse(new Response('', $expectedStatusCode)); }); @@ -215,20 +213,19 @@ class HttpKernelTest extends TestCase public function testHandleWhenTheControllerDoesNotReturnAResponse() { $dispatcher = new EventDispatcher(); - $kernel = $this->getHttpKernel($dispatcher, function () { return 'foo'; }); + $kernel = $this->getHttpKernel($dispatcher, function () {}); try { $kernel->handle(new Request()); $this->fail('The kernel should throw an exception.'); } catch (ControllerDoesNotReturnResponseException $e) { - } + $first = $e->getTrace()[0]; - $first = $e->getTrace()[0]; - - // `file` index the array starting at 0, and __FILE__ starts at 1 - $line = file($first['file'])[$first['line'] - 2]; - $this->assertContains('// call controller', $line); + // `file` index the array starting at 0, and __FILE__ starts at 1 + $line = file($first['file'])[$first['line'] - 2]; + $this->assertContains('// call controller', $line); + } } public function testHandleWhenTheControllerDoesNotReturnAResponseButAViewIsRegistered() @@ -257,7 +254,7 @@ class HttpKernelTest extends TestCase public function testHandleAllowChangingControllerArguments() { $dispatcher = new EventDispatcher(); - $dispatcher->addListener(KernelEvents::CONTROLLER_ARGUMENTS, function (FilterControllerArgumentsEvent $event) { + $dispatcher->addListener(KernelEvents::CONTROLLER_ARGUMENTS, function ($event) { $event->setArguments(['foo']); }); @@ -269,7 +266,7 @@ class HttpKernelTest extends TestCase public function testHandleAllowChangingControllerAndArguments() { $dispatcher = new EventDispatcher(); - $dispatcher->addListener(KernelEvents::CONTROLLER_ARGUMENTS, function (FilterControllerArgumentsEvent $event) { + $dispatcher->addListener(KernelEvents::CONTROLLER_ARGUMENTS, function ($event) { $oldController = $event->getController(); $oldArguments = $event->getArguments(); |
