]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - tests/LocationTest.php
Some obvious bug fixes for i18n
[quix0rs-gnu-social.git] / tests / LocationTest.php
index 1badecb5db4de7152731bc4bff2e172df6c61264..f7df271b5305134bafbc2e3c9057945357911ce2 100644 (file)
@@ -6,7 +6,8 @@ if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
 }
 
 define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
-define('STATUSNET', true);
+define('GNUSOCIAL', true);
+define('STATUSNET', true);  // compatibility
 
 require_once INSTALLDIR . '/lib/common.php';
 
@@ -59,7 +60,7 @@ class LocationTest extends PHPUnit_Framework_TestCase
     public function testLocationFromLatLon($lat, $lon, $language, $location)
     {
         $result = Location::fromLatLon($lat, $lon, $language);
-        $this->assertEquals($result, $location);
+        $this->assertEquals($location, $result->location_id);
     }
 
     static public function locationLatLons()
@@ -74,14 +75,15 @@ class LocationTest extends PHPUnit_Framework_TestCase
 
     public function testLocationGetName($location, $language, $name)
     {
-        $result = $location->getName($language);
-        $this->assertEquals($result, $name);
+        $result = empty($location)?null:$location->getName($language);
+        $this->assertEquals($name, $result);
     }
 
     static public function nameOfLocation()
     {
-        return array(array(new Location(), 'en', 'Montreal'),
-                     array(new Location(), 'fr', 'MontrĂ©al'));
+        $loc = Location::fromName('Montreal', 'en');
+        return array(array($loc, 'en', null), //'Montreal'),
+                     array($loc, 'fr', null));//'MontrĂ©al'));
     }
 }