. */ 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; /** * @return void */ 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' => '', 'obje_xref' => '', ]); $response = $handler->handle($request); self::assertSame(StatusCodeInterface::STATUS_NO_CONTENT, $response->getStatusCode()); } }