190949315SGreg Roach<?php 290949315SGreg Roach 390949315SGreg Roach/** 490949315SGreg Roach * webtrees: online genealogy 5*5bfc6897SGreg Roach * Copyright (C) 2022 webtrees development team 690949315SGreg Roach * This program is free software: you can redistribute it and/or modify 790949315SGreg Roach * it under the terms of the GNU General Public License as published by 890949315SGreg Roach * the Free Software Foundation, either version 3 of the License, or 990949315SGreg Roach * (at your option) any later version. 1090949315SGreg Roach * This program is distributed in the hope that it will be useful, 1190949315SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 1290949315SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1390949315SGreg Roach * GNU General Public License for more details. 1490949315SGreg Roach * You should have received a copy of the GNU General Public License 1589f7189bSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>. 1690949315SGreg Roach */ 1790949315SGreg Roach 1890949315SGreg Roachdeclare(strict_types=1); 1990949315SGreg Roach 2090949315SGreg Roachnamespace Fisharebest\Webtrees\Http\RequestHandlers; 2190949315SGreg Roach 2290949315SGreg Roachuse Fig\Http\Message\StatusCodeInterface; 2390949315SGreg Roachuse Fisharebest\Webtrees\Services\MapDataService; 2490949315SGreg Roachuse Fisharebest\Webtrees\TestCase; 2590949315SGreg Roach 2690949315SGreg Roach/** 2790949315SGreg Roach * Test the location export. 2890949315SGreg Roach * 2990949315SGreg Roach * @covers \Fisharebest\Webtrees\Http\RequestHandlers\MapDataExportCSV 3090949315SGreg Roach */ 3190949315SGreg Roachclass MapDataExportCSVTest extends TestCase 3290949315SGreg Roach{ 33cd94ca66SGreg Roach protected static bool $uses_database = true; 3490949315SGreg Roach 3590949315SGreg Roach /** 3690949315SGreg Roach * @return void 3790949315SGreg Roach */ 3890949315SGreg Roach public function testExportCSV(): void 3990949315SGreg Roach { 4090949315SGreg Roach $map_data_service = new MapDataService(); 4190949315SGreg Roach $handler = new MapDataExportCSV($map_data_service); 4290949315SGreg Roach $request = self::createRequest(); 4390949315SGreg Roach $response = $handler->handle($request); 4490949315SGreg Roach 4590949315SGreg Roach self::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode()); 4690949315SGreg Roach self::assertSame($response->getHeaderLine('Content-Type'), 'text/csv; charset=UTF-8'); 4790949315SGreg Roach } 4890949315SGreg Roach} 49