. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Http\Middleware; use Fig\Http\Message\StatusCodeInterface; use Fisharebest\Webtrees\TestCase; use Psr\Http\Server\RequestHandlerInterface; use function response; /** * Test the NoRouteFound middleware. * * @covers \Fisharebest\Webtrees\Http\Middleware\NoRouteFound */ class NoRouteFoundTest extends TestCase { public function testMiddleware(): void { $handler = $this->createMock(RequestHandlerInterface::class); $handler->method('handle')->willReturn(response()); $request = self::createRequest(); $middleware = new NoRouteFound(); $response = $middleware->process($request, $handler); self::assertSame(StatusCodeInterface::STATUS_FOUND, $response->getStatusCode()); } }