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.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/www/wiki/extensions/Maps/tests/Integration/Parser/DisplayMapTest.php b/www/wiki/extensions/Maps/tests/Integration/Parser/DisplayMapTest.php
index ef841f13..9bd64bcf 100644
--- a/www/wiki/extensions/Maps/tests/Integration/Parser/DisplayMapTest.php
+++ b/www/wiki/extensions/Maps/tests/Integration/Parser/DisplayMapTest.php
@@ -10,6 +10,19 @@ use PHPUnit\Framework\TestCase;
*/
class DisplayMapTest extends TestCase {
+ private $originalHeight;
+ private $originalWidth;
+
+ public function setUp() {
+ $this->originalHeight = $GLOBALS['egMapsMapHeight'];
+ $this->originalWidth = $GLOBALS['egMapsMapWidth'];
+ }
+
+ public function tearDown() {
+ $GLOBALS['egMapsMapHeight'] = $this->originalHeight;
+ $GLOBALS['egMapsMapWidth'] = $this->originalWidth;
+ }
+
public function testMapIdIsSet() {
$this->assertContains(
'id="map_leaflet_',
@@ -144,6 +157,21 @@ class DisplayMapTest extends TestCase {
);
}
+ public function testDimensionDefaultsAsInteger() {
+ $GLOBALS['egMapsMapHeight'] = 420;
+ $GLOBALS['egMapsMapWidth'] = 230;
+
+ $this->assertContains(
+ 'height: 420px;',
+ $this->parse( '{{#display_map:1,1}}' )
+ );
+
+ $this->assertContains(
+ 'width: 230px;',
+ $this->parse( '{{#display_map:1,1}}' )
+ );
+ }
+
// TODO: need DI to test
// public function testWhenLocationHasVisitedIconModifier_itIsUsed() {
// $this->assertContains(