. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Http\RequestHandlers; use Fig\Http\Message\RequestMethodInterface; use Fig\Http\Message\StatusCodeInterface; use Fisharebest\Webtrees\Services\GedcomImportService; use Fisharebest\Webtrees\Services\TreeService; use Fisharebest\Webtrees\TestCase; /** * Test FixLevel0MediaActionTest class. * * @covers \Fisharebest\Webtrees\Http\RequestHandlers\FixLevel0MediaActionTest */ class FixLevel0MediaActionTest extends TestCase { protected static bool $uses_database = true; public function testFixLevel0MediaAction(): void { $gedcom_import_service = new GedcomImportService(); $tree_service = new TreeService($gedcom_import_service); $tree = $tree_service->create('name', 'title'); $handler = new FixLevel0MediaAction($tree_service); $request = self::createRequest(RequestMethodInterface::METHOD_POST, [], [ 'tree_id' => $tree->id(), 'fact_id' => '', 'indi_xref' => 'X1', 'obje_xref' => 'X2', ]); $response = $handler->handle($request); self::assertSame(StatusCodeInterface::STATUS_NO_CONTENT, $response->getStatusCode()); } }