diff --git a/src/MissingRouteDispatching.php b/src/MissingRouteDispatching.php new file mode 100644 index 0000000..e119025 --- /dev/null +++ b/src/MissingRouteDispatching.php @@ -0,0 +1,17 @@ +getMethod(), $request->getUri()), self::HTTP_STATUS); + } +} diff --git a/tests/MissingRouteDispatchingTest.php b/tests/MissingRouteDispatchingTest.php new file mode 100644 index 0000000..399b349 --- /dev/null +++ b/tests/MissingRouteDispatchingTest.php @@ -0,0 +1,36 @@ +expectException(NoRouteMatched::class); + $this->expectExceptionCode(404); + $this->expectExceptionMessage('Cannot GET /testing'); + + $middleware->process( + new ServerRequest([], [], '/testing', 'GET'), + $this->createMock(RequestHandlerInterface::class) + ); + } +}