. */ 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 PHPUnit\Framework\Attributes\CoversClass; use function dirname; #[CoversClass(MapDataImportAction::class)] class MapDataImportActionTest extends TestCase { protected static bool $uses_database = true; 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()); } }