diff --git a/test/libraries/PMA_tbl_gis_visualization_test.php b/test/libraries/PMA_tbl_gis_visualization_test.php new file mode 100644 index 0000000000..e17b17c2fb --- /dev/null +++ b/test/libraries/PMA_tbl_gis_visualization_test.php @@ -0,0 +1,243 @@ +getMockBuilder('PMA_DatabaseInterface') + ->disableOriginalConstructor() + ->getMock(); + + $GLOBALS['dbi'] = $dbi; + } + + /** + * Tests for PMA_getHtmlForOptionsList() method. + * + * @return void + * @test + */ + public function testPMAGetHtmlForOptionsList() + { + $options= array("option1", "option2"); + $select = "option2"; + + $html = PMA_getHtmlForOptionsList($options, $select); + + $this->assertEquals( + '' + . '', + $html + ); + } + + /** + * Tests for PMA_getHtmlForUseOpenStreetMaps() method. + * + * @return void + * @test + */ + public function testPMAGetHtmlForUseOpenStreetMaps() + { + $isSelected = true; + + $html = PMA_getHtmlForUseOpenStreetMaps($isSelected); + + $this->assertContains( + 'assertContains( + __("Use OpenStreetMaps as Base Layer"), + $html + ); + } + + /** + * Tests for PMA_getHtmlForColumn() method. + * + * @return void + * @test + */ + public function testPMAGetHtmlForColumn() + { + $column = 0; + $columnCandidates = array("option1", "option2"); + $visualizationSettings = array("option2", "option3"); + + $html = PMA_getHtmlForColumn( + $column, $columnCandidates, $visualizationSettings + ); + + $this->assertContains( + '