[geos-commits] r3707 - branches/3.3/php/test

svn_geos at osgeo.org svn_geos at osgeo.org
Thu Sep 6 11:15:18 PDT 2012


Author: strk
Date: 2012-09-06 11:15:17 -0700 (Thu, 06 Sep 2012)
New Revision: 3707

Modified:
   branches/3.3/php/test/test.php
Log:
Use version_compare to compare versions...

Modified: branches/3.3/php/test/test.php
===================================================================
--- branches/3.3/php/test/test.php	2012-09-06 18:05:59 UTC (rev 3706)
+++ branches/3.3/php/test/test.php	2012-09-06 18:15:17 UTC (rev 3707)
@@ -5,9 +5,8 @@
 
 dl("geos.so");
 
-$phpunit_versions = explode('.', PHPUnit_Runner_Version::id());
-$phpunit_version = $phpunit_versions[0] . $phpunit_versions[1];
-if ( $phpunit_version < 36 ) require_once 'PHPUnit/Framework.php';
+if ( version_compare(PHPUnit_Runner_Version::id(), '3.6') < 0 )
+    require_once 'PHPUnit/Framework.php';
 
 
 class test extends PHPUnit_Framework_TestCase
@@ -15,8 +14,9 @@
     # This method override is needed to support phpunit < 3.5 (Ubuntu 10.04 ships 3.4)
     static public function assertType($x, $y)
     {
-        global $phpunit_version;
-        if ( $phpunit_version < 35 ) return PHPUnit_Framework_TestCase::assertType($x, $y);
+        #global $phpunit_version;
+        if ( version_compare(PHPUnit_Runner_Version::id(), '3.5') < 0 )
+            return PHPUnit_Framework_TestCase::assertType($x, $y);
         else return PHPUnit_Framework_TestCase::assertInternalType($x, $y);
     }
 



More information about the geos-commits mailing list