public function reverse($latitude, $longitude)
{
if (null === $this->username) {
throw new InvalidCredentials('No username provided.');
}
$query = sprintf(self::REVERSE_ENDPOINT_URL, $latitude, $longitude, $this->getLimit(), $this->username);
return $this->executeQuery($query);
}
/** * @expectedException \Geocoder\Exception\NoResult * @expectedExceptionMessage Could not execute query "http://api.geonames.org/findNearbyPlaceNameJSON?lat=-80.000000&lng=-170.000000&style=full&maxRows=5&username=username". */ public function testReverseWithBadCoordinates() { $badCoordinateResponse = <<<JSON { "geonames": [ ] } JSON; $provider = new Geonames($this->getMockAdapterReturns($badCoordinateResponse), 'username'); $provider->reverse(-80.0, -170.0); }