xref: /webtrees/tests/app/Http/RequestHandlers/FixLevel0MediaActionTest.php (revision 5bfc689774bb9a6401271c4ed15a6d50652c991b)
14b3ef6caSGreg Roach<?php
24b3ef6caSGreg Roach
34b3ef6caSGreg Roach/**
44b3ef6caSGreg Roach * webtrees: online genealogy
5*5bfc6897SGreg Roach * Copyright (C) 2022 webtrees development team
64b3ef6caSGreg Roach * This program is free software: you can redistribute it and/or modify
74b3ef6caSGreg Roach * it under the terms of the GNU General Public License as published by
84b3ef6caSGreg Roach * the Free Software Foundation, either version 3 of the License, or
94b3ef6caSGreg Roach * (at your option) any later version.
104b3ef6caSGreg Roach * This program is distributed in the hope that it will be useful,
114b3ef6caSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
124b3ef6caSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
134b3ef6caSGreg Roach * GNU General Public License for more details.
144b3ef6caSGreg Roach * You should have received a copy of the GNU General Public License
154b3ef6caSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
164b3ef6caSGreg Roach */
174b3ef6caSGreg Roach
184b3ef6caSGreg Roachdeclare(strict_types=1);
194b3ef6caSGreg Roach
204b3ef6caSGreg Roachnamespace Fisharebest\Webtrees\Http\RequestHandlers;
214b3ef6caSGreg Roach
224b3ef6caSGreg Roachuse Fig\Http\Message\RequestMethodInterface;
234b3ef6caSGreg Roachuse Fig\Http\Message\StatusCodeInterface;
242c685d76SGreg Roachuse Fisharebest\Webtrees\Services\GedcomImportService;
254b3ef6caSGreg Roachuse Fisharebest\Webtrees\Services\TreeService;
264b3ef6caSGreg Roachuse Fisharebest\Webtrees\TestCase;
274b3ef6caSGreg Roach
284b3ef6caSGreg Roach/**
294b3ef6caSGreg Roach * Test FixLevel0MediaActionTest class.
304b3ef6caSGreg Roach *
314b3ef6caSGreg Roach * @covers \Fisharebest\Webtrees\Http\RequestHandlers\FixLevel0MediaActionTest
324b3ef6caSGreg Roach */
334b3ef6caSGreg Roachclass FixLevel0MediaActionTest extends TestCase
344b3ef6caSGreg Roach{
35cd94ca66SGreg Roach    protected static bool $uses_database = true;
364b3ef6caSGreg Roach
374b3ef6caSGreg Roach    /**
384b3ef6caSGreg Roach     * @return void
394b3ef6caSGreg Roach     */
404b3ef6caSGreg Roach    public function testFixLevel0MediaAction(): void
414b3ef6caSGreg Roach    {
422c685d76SGreg Roach        $gedcom_import_service = new GedcomImportService();
432c685d76SGreg Roach        $tree_service          = new TreeService($gedcom_import_service);
444b3ef6caSGreg Roach        $tree                  = $tree_service->create('name', 'title');
454b3ef6caSGreg Roach        $handler               = new FixLevel0MediaAction($tree_service);
464b3ef6caSGreg Roach        $request               = self::createRequest(RequestMethodInterface::METHOD_POST, [], [
474b3ef6caSGreg Roach            'tree_id'   => $tree->id(),
484b3ef6caSGreg Roach            'fact_id'   => '',
494b3ef6caSGreg Roach            'indi_xref' => '',
504b3ef6caSGreg Roach            'obje_xref' => '',
514b3ef6caSGreg Roach        ]);
524b3ef6caSGreg Roach        $response              = $handler->handle($request);
534b3ef6caSGreg Roach
544b3ef6caSGreg Roach        self::assertSame(StatusCodeInterface::STATUS_NO_CONTENT, $response->getStatusCode());
554b3ef6caSGreg Roach    }
564b3ef6caSGreg Roach}
57