. */ declare(strict_types=1); namespace Fisharebest\Webtrees; use Fig\Http\Message\RequestMethodInterface; use Fig\Http\Message\StatusCodeInterface; use Fisharebest\Webtrees\Module\IndividualListModule; use Fisharebest\Webtrees\Services\LocalizationService; /** * Test the individual lists. * * @coversNothing */ class IndividualListTest extends TestCase { protected static $uses_database = true; /** * @covers \Fisharebest\Webtrees\Module\IndividualListModule * @return void */ public function testIndividualList(): void { $tree = $this->importTree('demo.ged'); $list_module = new IndividualListModule(new LocalizationService()); $request = self::createRequest(RequestMethodInterface::METHOD_GET, [], [], [], ['tree' => $tree]); $response = $list_module->handle($request); self::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode()); $request = self::createRequest(RequestMethodInterface::METHOD_GET, ['alpha' => 'B'], [], [], ['tree' => $tree]); $response = $list_module->handle($request); self::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode()); $request = self::createRequest(RequestMethodInterface::METHOD_GET, ['alpha' => ','], [], [], ['tree' => $tree]); $response = $list_module->handle($request); self::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode()); $request = self::createRequest(RequestMethodInterface::METHOD_GET, ['alpha' => '@'], [], [], ['tree' => $tree]); $response = $list_module->handle($request); self::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode()); $request = self::createRequest(RequestMethodInterface::METHOD_GET, ['surname' => 'BRAUN'], [], [], ['tree' => $tree]); $response = $list_module->handle($request); self::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode()); } }