|
9 | 9 | use Tempest\Core\AppConfig; |
10 | 10 | use Tempest\Core\FrameworkKernel; |
11 | 11 | use Tempest\Core\Kernel; |
| 12 | +use Tempest\Http\GenericRequest; |
12 | 13 | use Tempest\Http\HttpRequestFailed; |
| 14 | +use Tempest\Http\Method; |
13 | 15 | use Tempest\Http\Response; |
14 | 16 | use Tempest\Http\Responses\Redirect; |
15 | 17 | use Tempest\Http\Session\CsrfTokenDidNotMatch; |
16 | 18 | use Tempest\Http\Status; |
17 | 19 | use Tempest\Router\Exceptions\HttpExceptionHandler; |
18 | | -use Tempest\Router\Exceptions\RouteBindingFailed; |
19 | 20 | use Tempest\Router\ResponseSender; |
20 | 21 | use Tests\Tempest\Integration\FrameworkIntegrationTestCase; |
21 | 22 | use Tests\Tempest\Integration\Http\Fixtures\ExceptionThatConvertsToRedirectResponse; |
22 | 23 | use Tests\Tempest\Integration\Http\Fixtures\ExceptionWithContext; |
23 | 24 | use Tests\Tempest\Integration\Http\Fixtures\NullExceptionProcessor; |
| 25 | +use Throwable; |
24 | 26 |
|
25 | 27 | final class HttpExceptionHandlerTest extends FrameworkIntegrationTestCase |
26 | 28 | { |
@@ -125,7 +127,7 @@ public function test_exception_handler_returns_same_code_as_http_exception(Statu |
125 | 127 | { |
126 | 128 | $this->callExceptionHandler(function () use ($status): void { |
127 | 129 | $handler = $this->container->get(HttpExceptionHandler::class); |
128 | | - $handler->handle(new HttpRequestFailed($status)); |
| 130 | + $handler->handle(new HttpRequestFailed(new GenericRequest(Method::GET, '/test'), $status)); |
129 | 131 | }); |
130 | 132 |
|
131 | 133 | $this->assertSame($status, $this->response->status); |
@@ -164,7 +166,7 @@ private function callExceptionHandler(Closure $callback): void |
164 | 166 | { |
165 | 167 | try { |
166 | 168 | $callback(); |
167 | | - } catch (\Throwable $throwable) { |
| 169 | + } catch (Throwable $throwable) { |
168 | 170 | $this->assertSame('Shutdown.', $throwable->getMessage()); |
169 | 171 | } |
170 | 172 | } |
|
0 commit comments