Skip to content

Commit

Permalink
chevere 4
Browse files Browse the repository at this point in the history
  • Loading branch information
rodber committed Dec 19, 2023
1 parent 2e955ed commit ec1e53a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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}();
Expand Down
2 changes: 1 addition & 1 deletion tests/ControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/RedirectStaticControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ec1e53a

Please sign in to comment.