diff --git a/src/Controller.php b/src/Controller.php index 9cf1791..6897c74 100644 --- a/src/Controller.php +++ b/src/Controller.php @@ -18,7 +18,9 @@ use Chevere\Parameter\Interfaces\ArgumentsInterface; use Chevere\Parameter\Interfaces\ArrayParameterInterface; use Chevere\Parameter\Interfaces\ArrayStringParameterInterface; +use Chevere\Parameter\Interfaces\ParameterInterface; use LogicException; +use ReflectionMethod; use Throwable; use function Chevere\Message\message; use function Chevere\Parameter\arguments; @@ -105,8 +107,10 @@ final public function files(): array ??= []; } - protected function assertRuntime(): void - { + protected function assertRuntime( + ReflectionMethod $reflection, + ParameterInterface $return, + ): void { foreach (['query', 'body', 'files'] as $method) { try { $this->{$method}(); diff --git a/tests/ControllerTest.php b/tests/ControllerTest.php index 87cbc67..70f5ffd 100644 --- a/tests/ControllerTest.php +++ b/tests/ControllerTest.php @@ -29,7 +29,7 @@ public function testAssertRuntime(): void $controller = new AcceptController(); $this->expectException(LogicException::class); $this->expectExceptionMessage('query: Missing required argument(s): `foo`'); - $controller->getResponse(); + $controller->__invoke(); } public function testDefaults(): void diff --git a/tests/RedirectStaticControllerTest.php b/tests/RedirectStaticControllerTest.php index e34e86b..42f8b01 100644 --- a/tests/RedirectStaticControllerTest.php +++ b/tests/RedirectStaticControllerTest.php @@ -39,7 +39,7 @@ public function testWithUri(): void 'uri' => $controllerWithUri->uri(), 'status' => $controllerWithUri->status(), ], - $controllerWithUri->getResponse()->array() + $controllerWithUri->__invoke()->array() ); $this->assertNotSame($controller, $controllerWithUri); $this->assertNotEquals($controller, $controllerWithUri);