X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=tests%2FLocationTest.php;h=f7df271b5305134bafbc2e3c9057945357911ce2;hb=9cc7df51d64bb9b829e4a54ee2449c542209550d;hp=62849eb9f4a2a9ed9535dc7a85ff8e3abbfe4728;hpb=61ccf450de29a0433cd35415c6f2a3c7bbcbb91b;p=quix0rs-gnu-social.git diff --git a/tests/LocationTest.php b/tests/LocationTest.php index 62849eb9f4..f7df271b53 100644 --- a/tests/LocationTest.php +++ b/tests/LocationTest.php @@ -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'; @@ -48,8 +49,8 @@ class LocationTest extends PHPUnit_Framework_TestCase static public function locationIds() { - return array(array(6077243, GeonamesPlugin::NAMESPACE, 'en', null), - array(5391959, GeonamesPlugin::NAMESPACE, 'en', null)); + return array(array(6077243, GeonamesPlugin::LOCATION_NS, 'en', null), + array(5391959, GeonamesPlugin::LOCATION_NS, 'en', null)); } /** @@ -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')); } }