. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Http\RequestHandlers; use Fig\Http\Message\RequestMethodInterface; use Fig\Http\Message\StatusCodeInterface; use Fisharebest\Webtrees\TestCase; use Nyholm\Psr7\Factory\Psr17Factory; use function dirname; /** * Test the location import. * * @covers \Fisharebest\Webtrees\Http\RequestHandlers\MapDataImportAction */ class MapDataImportActionTest extends TestCase { protected static bool $uses_database = true; /** * @return void */ public function testImportAction(): void { $csv = $this->createUploadedFile(dirname(__DIR__, 3) . '/data/places.csv', 'text/csv'); $handler = new MapDataImportAction(new Psr17Factory()); $request = self::createRequest(RequestMethodInterface::METHOD_POST, [], ['options' => 'add', 'source' => 'client'], ['localfile' => $csv]); $response = $handler->handle($request); self::assertSame(StatusCodeInterface::STATUS_FOUND, $response->getStatusCode()); } }