3 * Test for PMA_GIS_Point
5 * @package phpMyAdmin-test
8 require_once 'PMA_GIS_Geometry_test.php';
9 require_once 'libraries/gis/pma_gis_geometry.php';
10 require_once 'libraries/gis/pma_gis_point.php';
13 * Tests for PMA_GIS_Point class.
15 class PMA_GIS_PointTest
extends PMA_GIS_GeometryTest
24 * Sets up the fixture, for example, opens a network connection.
25 * This method is called before a test is executed.
30 protected function setUp()
32 $this->object = PMA_GIS_Point
::singleton();
36 * Tears down the fixture, for example, closes a network connection.
37 * This method is called after a test is executed.
42 protected function tearDown()
48 * data provider for testGenerateWkt
50 * @return data for testGenerateWkt
52 public function providerForTestGenerateWkt()
56 array(0 => array('POINT' => array('x' => 5.02, 'y' => 8.45))),
62 array(0 => array('POINT' => array('x' => 5.02, 'y' => 8.45))),
68 array(0 => array('POINT' => array('x' => 5.02))),
74 array(0 => array('POINT' => array('y' => 8.45))),
80 array(0 => array('POINT' => array())),
89 * test getShape method
91 * @param array $row_data array of GIS data
92 * @param string $shape expected shape in WKT
94 * @dataProvider providerForTestGetShape
97 public function testGetShape($row_data, $shape)
99 $this->assertEquals($this->object->getShape($row_data), $shape);
103 * data provider for testGetShape
105 * @return data for testGetShape
107 public function providerForTestGetShape()
111 array('x' => 5.02, 'y' => 8.45),
118 * data provider for testGenerateParams
120 * @return data for testGenerateParams
122 public function providerForTestGenerateParams()
126 "'POINT(5.02 8.45)',124",
131 'POINT' => array('x' => '5.02', 'y' => '8.45')
140 'gis_type' => 'POINT',
141 'POINT' => array('x' => '5.02', 'y' => '8.45')