summaryrefslogtreecommitdiff
path: root/tests/app/Http/RequestHandlers
diff options
context:
space:
mode:
Diffstat (limited to 'tests/app/Http/RequestHandlers')
-rw-r--r--tests/app/Http/RequestHandlers/MapProviderActionTest.php46
-rw-r--r--tests/app/Http/RequestHandlers/MapProviderPageTest.php45
2 files changed, 91 insertions, 0 deletions
diff --git a/tests/app/Http/RequestHandlers/MapProviderActionTest.php b/tests/app/Http/RequestHandlers/MapProviderActionTest.php
new file mode 100644
index 0000000000..045fbcb604
--- /dev/null
+++ b/tests/app/Http/RequestHandlers/MapProviderActionTest.php
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * webtrees: online genealogy
+ * Copyright (C) 2020 webtrees development team
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+declare(strict_types=1);
+
+namespace Fisharebest\Webtrees\Http\RequestHandlers;
+
+use Fig\Http\Message\RequestMethodInterface;
+use Fig\Http\Message\StatusCodeInterface;
+use Fisharebest\Webtrees\TestCase;
+
+/**
+ * Test the MapProviderAction request handler.
+ *
+ * @covers \Fisharebest\Webtrees\Http\RequestHandlers\MapProviderAction
+ */
+class MapProviderActionTest extends TestCase
+{
+ protected static $uses_database = true;
+
+ /**
+ * @return void
+ */
+ public function testMapProviderAction(): void
+ {
+ $handler = new MapProviderAction();
+ $request = self::createRequest(RequestMethodInterface::METHOD_POST, [], ['provider' => '', 'geonames' => '']);
+ $response = $handler->handle($request);
+
+ self::assertSame(StatusCodeInterface::STATUS_FOUND, $response->getStatusCode());
+ }
+}
diff --git a/tests/app/Http/RequestHandlers/MapProviderPageTest.php b/tests/app/Http/RequestHandlers/MapProviderPageTest.php
new file mode 100644
index 0000000000..0ca2257046
--- /dev/null
+++ b/tests/app/Http/RequestHandlers/MapProviderPageTest.php
@@ -0,0 +1,45 @@
+<?php
+
+/**
+ * webtrees: online genealogy
+ * Copyright (C) 2020 webtrees development team
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+declare(strict_types=1);
+
+namespace Fisharebest\Webtrees\Http\RequestHandlers;
+
+use Fig\Http\Message\StatusCodeInterface;
+use Fisharebest\Webtrees\TestCase;
+
+/**
+ * Test the MapProviderPage request handler.
+ *
+ * @covers \Fisharebest\Webtrees\Http\RequestHandlers\MapProviderPage
+ */
+class MapProviderPageTest extends TestCase
+{
+ protected static $uses_database = true;
+
+ /**
+ * @return void
+ */
+ public function testMapProviderPage(): void
+ {
+ $handler = new MapProviderPage();
+ $request = self::createRequest();
+ $response = $handler->handle($request);
+
+ self::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
+ }
+}