diff options
author | Yaco <franco@reevo.org> | 2021-10-19 20:24:11 -0300 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2021-10-19 20:24:11 -0300 |
commit | e3880a1c86acaa3bbd05786ad2f5c586e6511a58 (patch) | |
tree | ec77bfc5b69f259a159c95188797bd0dade92357 /www/wiki/extensions/Maps/tests/Integration/Parser/DisplayMapTest.php | |
parent | 20ca0685509f8010580d3b45036a64ab48616af1 (diff) |
updates Maps to 7.13.0
Diffstat (limited to 'www/wiki/extensions/Maps/tests/Integration/Parser/DisplayMapTest.php')
-rw-r--r-- | www/wiki/extensions/Maps/tests/Integration/Parser/DisplayMapTest.php | 39 |
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 ,}}" + ) + ); + } + +} |