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