From 3d8e4b74d036a4d2177be02e51c431243b55951c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 13 Feb 2017 15:58:58 +0100 Subject: [PATCH 1/2] Fix GIS tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - correct order of parameters for assertEquals - fix expectations for zero values Signed-off-by: Michal Čihař --- test/classes/gis/GISGeometryTest.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/classes/gis/GISGeometryTest.php b/test/classes/gis/GISGeometryTest.php index d21b5596f8..a84c0236d5 100644 --- a/test/classes/gis/GISGeometryTest.php +++ b/test/classes/gis/GISGeometryTest.php @@ -71,11 +71,11 @@ class GISGeometryTest extends PHPUnit_Framework_TestCase public function testSetMinMax($point_set, $min_max, $output) { $this->assertEquals( + $output, $this->_callProtectedFunction( 'setMinMax', array($point_set, $min_max) - ), - $output + ) ); } @@ -127,11 +127,11 @@ class GISGeometryTest extends PHPUnit_Framework_TestCase public function testGenerateParams($value, $output) { $this->assertEquals( + $output, $this->_callProtectedFunction( 'generateParams', array($value) - ), - $output + ) ); } @@ -181,11 +181,11 @@ class GISGeometryTest extends PHPUnit_Framework_TestCase public function testExtractPoints($point_set, $scale_data, $linear, $output) { $this->assertEquals( + $output, $this->_callProtectedFunction( 'extractPoints', array($point_set, $scale_data, $linear) - ), - $output + ) ); } @@ -239,7 +239,7 @@ class GISGeometryTest extends PHPUnit_Framework_TestCase array( 0 => array(12, 35), 1 => array(48, 75), - 2 => array('', ''), + 2 => array(0, 0), ), ), ); @@ -258,11 +258,11 @@ class GISGeometryTest extends PHPUnit_Framework_TestCase public function testGetBoundsForOl($srid, $scale_data, $output) { $this->assertEquals( + $output, $this->_callProtectedFunction( 'getBoundsForOl', array($srid, $scale_data) - ), - $output + ) ); } @@ -307,11 +307,11 @@ class GISGeometryTest extends PHPUnit_Framework_TestCase public function testGetPolygonArrayForOpenLayers($polygons, $srid, $output) { $this->assertEquals( + $output, $this->_callProtectedFunction( 'getPolygonArrayForOpenLayers', array($polygons, $srid) - ), - $output + ) ); } @@ -331,7 +331,7 @@ class GISGeometryTest extends PHPUnit_Framework_TestCase . 'new Array(' . 'new OpenLayers.Geometry.LinearRing(' . 'new Array(' - . '(new OpenLayers.Geometry.Point(,)).transform(' + . '(new OpenLayers.Geometry.Point(0,0)).transform(' . 'new OpenLayers.Projection("EPSG:4326"), ' . 'map.getProjectionObject()))))))' ) From 87a2953b786d31932af86e1ea3c2ecdb53f8e807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 13 Feb 2017 15:59:36 +0100 Subject: [PATCH 2/2] Fix test expectations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- test/libraries/PMA_normalization_test.php | 1 + 1 file changed, 1 insertion(+) diff --git a/test/libraries/PMA_normalization_test.php b/test/libraries/PMA_normalization_test.php index a639dd3a9a..2a94193736 100644 --- a/test/libraries/PMA_normalization_test.php +++ b/test/libraries/PMA_normalization_test.php @@ -351,6 +351,7 @@ class PMA_Normalization_Test extends PHPUnit_Framework_TestCase $this->assertEquals( array( 'html' => '', + 'success' => true, 'newTables' => array() ), $result );