}
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
-define('STATUSNET', true);
+define('GNUSOCIAL', true);
+define('STATUSNET', true); // compatibility
require_once INSTALLDIR . '/lib/common.php';
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));
}
/**
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()
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'));
}
}