summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Maps/tests/Integration/Parser/DisplayMapTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/Maps/tests/Integration/Parser/DisplayMapTest.php')
-rw-r--r--www/wiki/extensions/Maps/tests/Integration/Parser/DisplayMapTest.php39
1 files changed, 38 insertions, 1 deletions
diff --git a/www/wiki/extensions/Maps/tests/Integration/Parser/DisplayMapTest.php b/www/wiki/extensions/Maps/tests/Integration/Parser/DisplayMapTest.php
index 9bd64bcf..4ef7c791 100644
--- a/www/wiki/extensions/Maps/tests/Integration/Parser/DisplayMapTest.php
+++ b/www/wiki/extensions/Maps/tests/Integration/Parser/DisplayMapTest.php
@@ -2,6 +2,7 @@
namespace Maps\Tests\Integration\Parser;
+use Maps\MediaWiki\Content\GeoJsonContent;
use PHPUnit\Framework\TestCase;
/**
@@ -217,4 +218,40 @@ class DisplayMapTest extends TestCase {
);
}
-} \ No newline at end of file
+ public function testGeoJsonSourceForFile() {
+ $this->assertContains(
+ '"GeoJsonSource":null,',
+ $this->parse(
+ "{{#display_map:geojson=404}}"
+ )
+ );
+ }
+
+ public function testGeoJsonSourceForPage() {
+ $page = new \WikiPage( \Title::newFromText( 'GeoJson:TestPageSource' ) );
+ $page->doEditContent(
+ new GeoJsonContent( json_encode( [
+ 'type' => 'FeatureCollection',
+ 'features' => []
+ ] ) ),
+ ''
+ );
+
+ $this->assertContains(
+ '"GeoJsonSource":"TestPageSource",',
+ $this->parse(
+ "{{#display_map:geojson=TestPageSource}}"
+ )
+ );
+ }
+
+ public function testGoogleMapsKmlFiltersInvalidFileNames() {
+ $this->assertContains(
+ '"kml":["ValidFile.kml"],',
+ $this->parse(
+ "{{#display_map:service=google|kml=, ,ValidFile.kml ,}}"
+ )
+ );
+ }
+
+}