From c888d7cbfd3a5f4b80060fa773a14656217d6363 Mon Sep 17 00:00:00 2001 From: Giorgio Premi Date: Tue, 13 Jan 2015 00:47:43 +0100 Subject: [PATCH 01/17] GeoIP2 results use underscore case --- src/Geocoder/Provider/GeoIP2.php | 4 ++-- tests/Geocoder/Tests/Provider/GeoIP2Test.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Geocoder/Provider/GeoIP2.php b/src/Geocoder/Provider/GeoIP2.php index dcc348a13..c5135e7b0 100644 --- a/src/Geocoder/Provider/GeoIP2.php +++ b/src/Geocoder/Provider/GeoIP2.php @@ -67,8 +67,8 @@ public function geocode($address) 'locality' => (isset($result->city->names->{$this->locale}) ? $result->city->names->{$this->locale} : null), 'latitude' => (isset($result->location->latitude) ? $result->location->latitude : null), 'longitude' => (isset($result->location->longitude) ? $result->location->longitude : null), - 'timezone' => (isset($result->location->timezone) ? $result->location->timezone : null), - 'postalCode' => (isset($result->location->postalcode) ? $result->location->postalcode : null), + 'timezone' => (isset($result->location->time_zone) ? $result->location->time_zone : null), + 'postalCode' => (isset($result->location->postal_code) ? $result->location->postal_code : null), 'region' => $region, 'regionCode' => $regionCode ))) diff --git a/tests/Geocoder/Tests/Provider/GeoIP2Test.php b/tests/Geocoder/Tests/Provider/GeoIP2Test.php index 189c2e196..7778759b6 100644 --- a/tests/Geocoder/Tests/Provider/GeoIP2Test.php +++ b/tests/Geocoder/Tests/Provider/GeoIP2Test.php @@ -94,7 +94,7 @@ public static function provideDataForRetrievingGeodata() 'regionCode' => 'HH', 'country' => 'Germany', 'countryCode' => 'DE', - 'timezone' => null, + 'timezone' => 'Europe/Berlin', ) ), 'Response with all data null' => array( From b280be5caa162f8b9ab3d620763fca8a01373361 Mon Sep 17 00:00:00 2001 From: Giorgio Premi Date: Fri, 16 Jan 2015 09:52:11 +0100 Subject: [PATCH 02/17] Fix Geocoder type hint --- src/Geocoder/Geocoder.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Geocoder/Geocoder.php b/src/Geocoder/Geocoder.php index 8c9c164ee..7be4d6a0d 100644 --- a/src/Geocoder/Geocoder.php +++ b/src/Geocoder/Geocoder.php @@ -10,7 +10,7 @@ namespace Geocoder; -use Geocoder\Model\Address; +use Geocoder\Model\AddressCollection; /** * @author William Durand @@ -27,7 +27,7 @@ interface Geocoder * * @param string $value * - * @return Address[] + * @return AddressCollection */ public function geocode($value); @@ -37,7 +37,7 @@ public function geocode($value); * @param double $latitude. * @param double $longitude * - * @return Address[] + * @return AddressCollection */ public function reverse($latitude, $longitude); From 10bd7c3635c6f8f4dcee6862c6b115cbab8ee9aa Mon Sep 17 00:00:00 2001 From: Giorgio Premi Date: Tue, 20 Jan 2015 00:10:01 +0100 Subject: [PATCH 03/17] Add AddressFactory type hint --- src/Geocoder/Model/AddressFactory.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Geocoder/Model/AddressFactory.php b/src/Geocoder/Model/AddressFactory.php index 90a4714d8..9b7eef09a 100644 --- a/src/Geocoder/Model/AddressFactory.php +++ b/src/Geocoder/Model/AddressFactory.php @@ -16,6 +16,10 @@ */ final class AddressFactory { + /** + * @param array $results + * @return \Geocoder\Model\AddressCollection + */ public function createFromArray(array $results) { $addresses = []; From 12d59a720f55a811363dab33cede1fa1690413fd Mon Sep 17 00:00:00 2001 From: Giorgio Premi Date: Tue, 20 Jan 2015 00:24:58 +0100 Subject: [PATCH 04/17] AddressCollection::first type hint --- src/Geocoder/Model/AddressCollection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Geocoder/Model/AddressCollection.php b/src/Geocoder/Model/AddressCollection.php index a86c96847..4d6b8712c 100644 --- a/src/Geocoder/Model/AddressCollection.php +++ b/src/Geocoder/Model/AddressCollection.php @@ -31,7 +31,7 @@ public function count() } /** - * @return Address + * @return Address|null */ public function first() { From fa52e579b45e6346a74b85105a7740ab898b6ae8 Mon Sep 17 00:00:00 2001 From: Giorgio Premi Date: Tue, 20 Jan 2015 09:44:14 +0100 Subject: [PATCH 05/17] ProviderAggregator always return AddressCollection --- src/Geocoder/ProviderAggregator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Geocoder/ProviderAggregator.php b/src/Geocoder/ProviderAggregator.php index 3bb79771c..33073b0ab 100644 --- a/src/Geocoder/ProviderAggregator.php +++ b/src/Geocoder/ProviderAggregator.php @@ -12,6 +12,7 @@ use Geocoder\Exception\ProviderNotRegistered; use Geocoder\Provider\Provider; +use Geocoder\Model\AddressCollection; /** * @author William Durand @@ -50,7 +51,7 @@ public function geocode($value) if (empty($value)) { // let's save a request - return []; + return new AddressCollection(); } return $this->getProvider() @@ -65,7 +66,7 @@ public function reverse($latitude, $longitude) { if (empty($latitude) || empty($longitude)) { // let's save a request - return []; + return new AddressCollection(); } return $this->getProvider() From 3678742fe901b929cb488029a6348d25f487ed73 Mon Sep 17 00:00:00 2001 From: Giorgio Premi Date: Tue, 20 Jan 2015 09:45:28 +0100 Subject: [PATCH 06/17] Remove useless @ from GeonamesTest --- tests/Geocoder/Tests/Provider/GeonamesTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Geocoder/Tests/Provider/GeonamesTest.php b/tests/Geocoder/Tests/Provider/GeonamesTest.php index a71bd2721..988d5f065 100644 --- a/tests/Geocoder/Tests/Provider/GeonamesTest.php +++ b/tests/Geocoder/Tests/Provider/GeonamesTest.php @@ -66,7 +66,6 @@ public function testGeocodeWithNull() /** * @expectedException \Geocoder\Exception\NoResult * @expectedExceptionMessage No places found for query "http://api.geonames.org/searchJSON?q=BlaBlaBla&maxRows=5&style=full&username=username". - * @ */ public function testGeocodeWithUnknownCity() { From e918322c2593f3ec6789b8c18fe9701a8c0fb59b Mon Sep 17 00:00:00 2001 From: Giorgio Premi Date: Tue, 20 Jan 2015 10:03:30 +0100 Subject: [PATCH 07/17] AddressCollection contructor docblock --- src/Geocoder/Model/AddressCollection.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Geocoder/Model/AddressCollection.php b/src/Geocoder/Model/AddressCollection.php index 4d6b8712c..263232e2f 100644 --- a/src/Geocoder/Model/AddressCollection.php +++ b/src/Geocoder/Model/AddressCollection.php @@ -9,6 +9,9 @@ final class AddressCollection implements \IteratorAggregate, \Countable */ private $addresses; + /** + * @param Address[] $addresses + */ public function __construct(array $addresses = []) { $this->addresses = array_values($addresses); From 204a3fdb47f0fe668cee1b6bc22f44ed1b6f5c59 Mon Sep 17 00:00:00 2001 From: Giorgio Premi Date: Thu, 29 Jan 2015 15:06:23 +0100 Subject: [PATCH 08/17] Add AddressCollection::has predicate --- src/Geocoder/Model/AddressCollection.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Geocoder/Model/AddressCollection.php b/src/Geocoder/Model/AddressCollection.php index 263232e2f..6a4c671f1 100644 --- a/src/Geocoder/Model/AddressCollection.php +++ b/src/Geocoder/Model/AddressCollection.php @@ -53,8 +53,17 @@ public function slice($offset, $length = null) return array_slice($this->addresses, $offset, $length); } + /** + * @return bool + */ + public function has($index) + { + return isset($this->addresses[$index]); + } + /** * @return Address + * @throws \OutOfBoundsException */ public function get($index) { From 813b2701bf706922363117a95ab81c2a1f7f5f1c Mon Sep 17 00:00:00 2001 From: Giorgio Premi Date: Tue, 27 Jan 2015 10:31:18 +0100 Subject: [PATCH 09/17] TomTom provider: handle "Developer Inactive" error --- src/Geocoder/Provider/TomTom.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Geocoder/Provider/TomTom.php b/src/Geocoder/Provider/TomTom.php index 755e70f56..8d1593cf7 100644 --- a/src/Geocoder/Provider/TomTom.php +++ b/src/Geocoder/Provider/TomTom.php @@ -104,6 +104,10 @@ private function executeQuery($query) $content = (string) $this->getAdapter()->get($query)->getBody(); + if (false !== stripos($content, "Developer Inactive")) { + throw new InvalidCredentials('Map API Key provided is not valid.'); + } + try { $xml = new \SimpleXmlElement($content); } catch (\Exception $e) { From 58e5defcba5b249e70b8d5091267b750995cac13 Mon Sep 17 00:00:00 2001 From: Giorgio Premi Date: Mon, 12 Jan 2015 12:09:07 +0100 Subject: [PATCH 10/17] Replace County and Region with AdminLevels --- README.md | 16 +- src/Geocoder/Exception/UnexpectedValue.php | 18 ++ src/Geocoder/Formatter/StringFormatter.php | 45 ++--- src/Geocoder/Geocoder.php | 2 +- src/Geocoder/Model/Address.php | 84 +++------- src/Geocoder/Model/AddressFactory.php | 28 +++- .../Model/{County.php => AdminLevel.php} | 27 ++- src/Geocoder/Model/AdminLevelCollection.php | 120 +++++++++++++ src/Geocoder/Model/Region.php | 67 -------- src/Geocoder/Provider/AbstractProvider.php | 5 +- src/Geocoder/Provider/ArcGISOnline.php | 12 +- src/Geocoder/Provider/BingMaps.php | 13 +- src/Geocoder/Provider/FreeGeoIp.php | 13 +- src/Geocoder/Provider/GeoIP2.php | 22 +-- src/Geocoder/Provider/GeoIPs.php | 37 +++-- src/Geocoder/Provider/GeoPlugin.php | 12 +- src/Geocoder/Provider/Geoip.php | 3 +- src/Geocoder/Provider/Geonames.php | 18 +- src/Geocoder/Provider/GoogleMaps.php | 16 +- src/Geocoder/Provider/IpInfoDb.php | 2 +- src/Geocoder/Provider/MapQuest.php | 25 ++- src/Geocoder/Provider/MaxMind.php | 19 +++ src/Geocoder/Provider/MaxMindBinary.php | 8 +- src/Geocoder/Provider/Nominatim.php | 69 ++++---- src/Geocoder/Provider/OpenCage.php | 13 +- src/Geocoder/Provider/TomTom.php | 2 +- src/Geocoder/Provider/Yandex.php | 8 +- .../Tests/Formatter/StringFormatterTest.php | 18 +- .../Tests/Model/AddressFactoryTest.php | 14 +- .../Tests/Provider/AbstractProviderTest.php | 2 - .../Tests/Provider/ArcGISOnlineTest.php | 47 +++--- .../Geocoder/Tests/Provider/BingMapsTest.php | 157 +++++++++++++----- .../Geocoder/Tests/Provider/FreeGeoIpTest.php | 22 +-- tests/Geocoder/Tests/Provider/GeoIP2Test.php | 52 ++++-- tests/Geocoder/Tests/Provider/GeoIPsTest.php | 18 +- .../Geocoder/Tests/Provider/GeoPluginTest.php | 9 +- tests/Geocoder/Tests/Provider/GeoipTest.php | 3 +- .../Geocoder/Tests/Provider/GeonamesTest.php | 62 ++++--- .../Tests/Provider/GoogleMapsTest.php | 17 +- tests/Geocoder/Tests/Provider/HostIpTest.php | 5 +- .../Geocoder/Tests/Provider/IpInfoDbTest.php | 14 +- .../Geocoder/Tests/Provider/MapQuestTest.php | 40 +++-- .../Tests/Provider/MaxMindBinaryTest.php | 14 +- tests/Geocoder/Tests/Provider/MaxMindTest.php | 58 +++---- .../Geocoder/Tests/Provider/OpenCageTest.php | 38 +++-- .../Tests/Provider/OpenStreetMapTest.php | 99 ++++++----- tests/Geocoder/Tests/Provider/TomTomTest.php | 32 ++-- tests/Geocoder/Tests/Provider/YandexTest.php | 38 +++-- 48 files changed, 882 insertions(+), 581 deletions(-) create mode 100644 src/Geocoder/Exception/UnexpectedValue.php rename src/Geocoder/Model/{County.php => AdminLevel.php} (63%) create mode 100644 src/Geocoder/Model/AdminLevelCollection.php delete mode 100644 src/Geocoder/Model/Region.php diff --git a/README.md b/README.md index 547756497..2961e9d89 100644 --- a/README.md +++ b/README.md @@ -106,12 +106,8 @@ objects (`AddressCollection`), each providing the following API: * `getLocality()` will return the `locality` or `city`; * `getPostalCode()` will return the `postalCode` or `zipcode`; * `getSubLocality()` will return the `city district`, or `sublocality`; -* `getCounty()` will return a `County` object (with `name` and `code` - properties); -* `getCountyCode()` will return the `county` code (county short name); -* `getRegion()` will return a `Region` object (with `name` and `code` - properties); -* `getRegionCode()` will return the `region` code (region short name); +* `getAdminLevels()` will return an ordered collection (`AdminLevelCollection`) + of `AdminLevel` object (with `level`, `name` and `code` properties); * `getCountry()` will return a `Country` object (with `name` and `code` properties); * `getCountryCode()` will return the ISO `country` code; @@ -478,13 +474,9 @@ Here is the mapping: * Zipcode: `%z` -* County: `%P` - -* County Code: `%p` - -* Region: `%R` +* Admin Level Name: `%A1`, `%A2`, `%A3`, `%A4`, `%A5` -* Region Code: `%r` +* Admin Level Code: `%a1`, `%a2`, `%a3`, `%a4`, `%a5` * Country: `%C` diff --git a/src/Geocoder/Exception/UnexpectedValue.php b/src/Geocoder/Exception/UnexpectedValue.php new file mode 100644 index 000000000..1bbd5c5ce --- /dev/null +++ b/src/Geocoder/Exception/UnexpectedValue.php @@ -0,0 +1,18 @@ + + */ +class UnexpectedValue extends \UnexpectedValueException implements Exception +{ +} diff --git a/src/Geocoder/Formatter/StringFormatter.php b/src/Geocoder/Formatter/StringFormatter.php index 757cfe3fe..696380766 100644 --- a/src/Geocoder/Formatter/StringFormatter.php +++ b/src/Geocoder/Formatter/StringFormatter.php @@ -11,35 +11,33 @@ namespace Geocoder\Formatter; use Geocoder\Model\Address; +use Geocoder\Model\AdminLevel; +use Geocoder\Model\AdminLevelCollection; /** * @author William Durand */ class StringFormatter { - const STREET_NUMBER = '%n'; + const STREET_NUMBER = '%n'; - const STREET_NAME = '%S'; + const STREET_NAME = '%S'; - const LOCALITY = '%L'; + const LOCALITY = '%L'; - const POSTAL_CODE = '%z'; + const POSTAL_CODE = '%z'; - const SUB_LOCALITY = '%D'; + const SUB_LOCALITY = '%D'; - const COUNTY = '%P'; + const ADMIN_LEVEL = '%A'; - const COUNTY_CODE = '%p'; + const ADMIN_LEVEL_CODE = '%a'; - const REGION = '%R'; + const COUNTRY = '%C'; - const REGION_CODE = '%r'; + const COUNTRY_CODE = '%c'; - const COUNTRY = '%C'; - - const COUNTRY_CODE = '%c'; - - const TIMEZONE = '%T'; + const TIMEZONE = '%T'; /** * Transform an `Address` instance into a string representation. @@ -51,19 +49,26 @@ class StringFormatter */ public function format(Address $address, $format) { - return strtr($format, array( + $tr = [ self::STREET_NUMBER => $address->getStreetNumber(), self::STREET_NAME => $address->getStreetName(), self::LOCALITY => $address->getLocality(), self::POSTAL_CODE => $address->getPostalCode(), self::SUB_LOCALITY => $address->getSubLocality(), - self::COUNTY => $address->getCounty()->getName(), - self::COUNTY_CODE => $address->getCounty()->getCode(), - self::REGION => $address->getRegion()->getName(), - self::REGION_CODE => $address->getRegion()->getCode(), self::COUNTRY => $address->getCountry()->getName(), self::COUNTRY_CODE => $address->getCountry()->getCode(), self::TIMEZONE => $address->getTimezone(), - )); + ]; + + $adminLevels = $address->getAdminLevels(); + $nullAdminLevel = new AdminLevel(null, null, null); + + for ($level = 1; $level <= AdminLevelCollection::MAX_LEVEL_DEPTH; ++ $level) { + $adminLevel = $adminLevels->has($level) ? $adminLevels->get($level) : $nullAdminLevel; + $tr[self::ADMIN_LEVEL . $level] = $adminLevel->getName(); + $tr[self::ADMIN_LEVEL_CODE . $level] = $adminLevel->getCode(); + } + + return strtr($format, $tr); } } diff --git a/src/Geocoder/Geocoder.php b/src/Geocoder/Geocoder.php index 7be4d6a0d..e84f4e890 100644 --- a/src/Geocoder/Geocoder.php +++ b/src/Geocoder/Geocoder.php @@ -34,7 +34,7 @@ public function geocode($value); /** * Reverses geocode given latitude and longitude values. * - * @param double $latitude. + * @param double $latitude * @param double $longitude * * @return AddressCollection diff --git a/src/Geocoder/Model/Address.php b/src/Geocoder/Model/Address.php index 97ffd4844..8eaf4cd47 100644 --- a/src/Geocoder/Model/Address.php +++ b/src/Geocoder/Model/Address.php @@ -51,14 +51,9 @@ final class Address private $postalCode; /** - * @var County + * @var AdminLevelCollection */ - private $county; - - /** - * @var Region - */ - private $region; + private $adminLevels; /** * @var Country @@ -78,17 +73,16 @@ final class Address * @param string $subLocality */ public function __construct( - Coordinates $coordinates = null, - Bounds $bounds = null, - $streetNumber = null, - $streetName = null, - $postalCode = null, - $locality = null, - $subLocality = null, - County $county = null, - Region $region = null, - Country $country = null, - $timezone = null + Coordinates $coordinates = null, + Bounds $bounds = null, + $streetNumber = null, + $streetName = null, + $postalCode = null, + $locality = null, + $subLocality = null, + AdminLevelCollection $adminLevels = null, + Country $country = null, + $timezone = null ) { $this->coordinates = $coordinates; $this->bounds = $bounds; @@ -97,8 +91,7 @@ public function __construct( $this->postalCode = $postalCode; $this->locality = $locality; $this->subLocality = $subLocality; - $this->county = $county; - $this->region = $region; + $this->adminLevels = $adminLevels ?: new AdminLevelCollection(); $this->country = $country; $this->timezone = $timezone; } @@ -203,43 +196,13 @@ public function getSubLocality() } /** - * Returns the county value. + * Returns the administrative levels. * - * @return County + * @return AdminLevelCollection */ - public function getCounty() + public function getAdminLevels() { - return $this->county; - } - - /** - * Returns the county short name. - * - * @return string - */ - public function getCountyCode() - { - return $this->county->getCode(); - } - - /** - * Returns the region value. - * - * @return Region - */ - public function getRegion() - { - return $this->region; - } - - /** - * Returns the region short name. - * - * @return string - */ - public function getRegionCode() - { - return $this->region->getCode(); + return $this->adminLevels; } /** @@ -279,6 +242,14 @@ public function getTimezone() */ public function toArray() { + $adminLevels = []; + foreach ($this->adminLevels as $adminLevel) { + $adminLevels[$adminLevel->getLevel()] = [ + 'name' => $adminLevel->getName(), + 'code' => $adminLevel->getCode() + ]; + } + return array( 'latitude' => $this->getLatitude(), 'longitude' => $this->getLongitude(), @@ -288,10 +259,7 @@ public function toArray() 'postalCode' => $this->postalCode, 'locality' => $this->locality, 'subLocality' => $this->subLocality, - 'county' => $this->county->getName(), - 'countyCode' => $this->county->getCode(), - 'region' => $this->region->getName(), - 'regionCode' => $this->region->getCode(), + 'adminLevels' => $adminLevels, 'country' => $this->country->getName(), 'countryCode' => $this->country->getCode(), 'timezone' => $this->timezone, diff --git a/src/Geocoder/Model/AddressFactory.php b/src/Geocoder/Model/AddressFactory.php index 9b7eef09a..8ad5b403e 100644 --- a/src/Geocoder/Model/AddressFactory.php +++ b/src/Geocoder/Model/AddressFactory.php @@ -24,6 +24,15 @@ public function createFromArray(array $results) { $addresses = []; foreach ($results as $result) { + $adminLevels = []; + foreach ($this->readArrayValue($result, 'adminLevels') as $adminLevel) { + $adminLevels[] = new AdminLevel( + intval($this->readStringValue($adminLevel, 'level')), + $this->readStringValue($adminLevel, 'name'), + $this->readStringValue($adminLevel, 'code') + ); + } + $addresses[] = new Address( $this->createCoordinates( $this->readDoubleValue($result, 'latitude'), @@ -40,14 +49,7 @@ public function createFromArray(array $results) $this->readStringValue($result, 'postalCode'), $this->readStringValue($result, 'locality'), $this->readStringValue($result, 'subLocality'), - new County( - $this->readStringValue($result, 'county'), - $this->upperize(\igorw\get_in($result, ['countyCode'])) - ), - new Region( - $this->readStringValue($result, 'region'), - $this->upperize(\igorw\get_in($result, ['regionCode'])) - ), + new AdminLevelCollection($adminLevels), new Country( $this->readStringValue($result, 'country'), $this->upperize(\igorw\get_in($result, ['countryCode'])) @@ -79,6 +81,16 @@ private function readStringValue(array $data, $key) return $this->valueOrNull(\igorw\get_in($data, [ $key ])); } + /** + * @param array $data + * @param string $key + * @return array + */ + private function readArrayValue(array $data, $key) + { + return \igorw\get_in($data, [ $key ]) ?: []; + } + /** * @return string|null */ diff --git a/src/Geocoder/Model/County.php b/src/Geocoder/Model/AdminLevel.php similarity index 63% rename from src/Geocoder/Model/County.php rename to src/Geocoder/Model/AdminLevel.php index 547da361d..77d079c24 100644 --- a/src/Geocoder/Model/County.php +++ b/src/Geocoder/Model/AdminLevel.php @@ -13,8 +13,13 @@ /** * @author William Durand */ -final class County +final class AdminLevel { + /** + * @var int + */ + private $level; + /** * @var string */ @@ -26,17 +31,29 @@ final class County private $code; /** + * @param int $level * @param string $name * @param string $code */ - public function __construct($name, $code) + public function __construct($level, $name, $code) { + $this->level = $level; $this->name = $name; $this->code = $code; } /** - * Returns the country name + * Returns the administrative level + * + * @return int Level number [1,5] + */ + public function getLevel() + { + return $this->level; + } + + /** + * Returns the administrative level name * * @return string */ @@ -46,7 +63,7 @@ public function getName() } /** - * Returns the county short name. + * Returns the administrative level short name. * * @return string */ @@ -56,7 +73,7 @@ public function getCode() } /** - * Returns a string with the county name. + * Returns a string with the administrative level name. * * @return string */ diff --git a/src/Geocoder/Model/AdminLevelCollection.php b/src/Geocoder/Model/AdminLevelCollection.php new file mode 100644 index 000000000..a1ac47e23 --- /dev/null +++ b/src/Geocoder/Model/AdminLevelCollection.php @@ -0,0 +1,120 @@ + + */ +final class AdminLevelCollection implements \IteratorAggregate, \Countable +{ + const MAX_LEVEL_DEPTH = 5; + + /** + * @var AdminLevel[] + */ + private $adminLevels; + + public function __construct(array $adminLevels = []) + { + $this->adminLevels = []; + + foreach ($adminLevels as $adminLevel) { + $level = $adminLevel->getLevel(); + + $this->checkLevel($level); + + if ($this->has($level)) { + throw new InvalidArgument(sprintf("Administrative level %d is defined twice", $level)); + } + + $this->adminLevels[$level] = $adminLevel; + } + + ksort($this->adminLevels, SORT_NUMERIC); + } + + /** + * {@inheritDoc} + */ + public function getIterator() + { + return new \ArrayIterator($this->all()); + } + + /** + * {@inheritDoc} + */ + public function count() + { + return count($this->adminLevels); + } + + /** + * @return AdminLevel|null + */ + public function first() + { + if (empty($this->adminLevels)) { + return null; + } + + return reset($this->adminLevels); + } + + /** + * @return AdminLevel[] + */ + public function slice($offset, $length = null) + { + return array_slice($this->adminLevels, $offset, $length, true); + } + + /** + * @return bool + */ + public function has($level) + { + return isset($this->adminLevels[$level]); + } + + /** + * @return AdminLevel + * @throws \OutOfBoundsException + * @throws InvalidArgument + */ + public function get($level) + { + $this->checkLevel($level); + + if (! isset($this->adminLevels[$level])) { + throw new InvalidArgument(sprintf("Administrative level %d is not set for this address", $level)); + } + + return $this->adminLevels[$level]; + } + + /** + * @return AdminLevel[] + */ + public function all() + { + return $this->adminLevels; + } + + /** + * @param integer $level + * @throws \OutOfBoundsException + */ + private function checkLevel($level) + { + if ($level <= 0 || $level > self::MAX_LEVEL_DEPTH) { + throw new \OutOfBoundsException(sprintf( + self::MAX_LEVEL_DEPTH, + "Administrative level should be an integer in [1,%d], %d given", + $level + )); + } + } +} diff --git a/src/Geocoder/Model/Region.php b/src/Geocoder/Model/Region.php deleted file mode 100644 index c366cec09..000000000 --- a/src/Geocoder/Model/Region.php +++ /dev/null @@ -1,67 +0,0 @@ - - */ -final class Region -{ - /** - * @var string - */ - private $name; - - /** - * @var string - */ - private $code; - - /** - * @param string $name - * @param string $code - */ - public function __construct($name, $code) - { - $this->name = $name; - $this->code = $code; - } - - /** - * Returns the region name - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Returns the region short name. - * - * @return string - */ - public function getCode() - { - return $this->code; - } - - /** - * Returns a string with the region name. - * - * @return string - */ - public function toString() - { - return $this->getName(); - } -} diff --git a/src/Geocoder/Provider/AbstractProvider.php b/src/Geocoder/Provider/AbstractProvider.php index 0d1327612..0f27bdcde 100644 --- a/src/Geocoder/Provider/AbstractProvider.php +++ b/src/Geocoder/Provider/AbstractProvider.php @@ -73,10 +73,7 @@ protected function getDefaults() 'locality' => null, 'postalCode' => null, 'subLocality' => null, - 'county' => null, - 'countyCode' => null, - 'region' => null, - 'regionCode' => null, + 'adminLevels' => [], 'country' => null, 'countryCode' => null, 'timezone' => null, diff --git a/src/Geocoder/Provider/ArcGISOnline.php b/src/Geocoder/Provider/ArcGISOnline.php index 7bdb75b16..da3994c98 100644 --- a/src/Geocoder/Provider/ArcGISOnline.php +++ b/src/Geocoder/Provider/ArcGISOnline.php @@ -83,10 +83,15 @@ public function geocode($address) $streetNumber = !empty($data->AddNum) ? $data->AddNum : null; $city = !empty($data->City) ? $data->City : null; $zipcode = !empty($data->Postal) ? $data->Postal : null; - $region = !empty($data->Region) ? $data->Region : null; - $county = !empty($data->Subregion) ? $data->Subregion : null; $countryCode = !empty($data->Country) ? $data->Country : null; + $adminLevels = []; + foreach (['Region', 'Subregion'] as $i => $property) { + if (! empty($data->{$property})) { + $adminLevels[] = ['name' => $data->{$property}, 'level' => $i + 1]; + } + } + $results[] = array_merge($this->getDefaults(), [ 'latitude' => $coordinates['y'], 'longitude' => $coordinates['x'], @@ -94,9 +99,8 @@ public function geocode($address) 'streetName' => $streetName, 'locality' => $city, 'postalCode' => $zipcode, - 'region' => $region, + 'adminLevels' => $adminLevels, 'countryCode' => $countryCode, - 'county' => $county, ]); } diff --git a/src/Geocoder/Provider/BingMaps.php b/src/Geocoder/Provider/BingMaps.php index fe089a851..74a57c59e 100644 --- a/src/Geocoder/Provider/BingMaps.php +++ b/src/Geocoder/Provider/BingMaps.php @@ -132,10 +132,16 @@ private function executeQuery($query) $streetName = property_exists($item->address, 'addressLine') ? (string) $item->address->addressLine : ''; $zipcode = property_exists($item->address, 'postalCode') ? (string) $item->address->postalCode : ''; $city = property_exists($item->address, 'locality') ? (string) $item->address->locality: ''; - $county = property_exists($item->address, 'adminDistrict2') ? (string) $item->address->adminDistrict2 : ''; - $region = property_exists($item->address, 'adminDistrict') ? (string) $item->address->adminDistrict: ''; $country = property_exists($item->address, 'countryRegion') ? (string) $item->address->countryRegion: ''; + $adminLevels = []; + + foreach (['adminDistrict', 'adminDistrict2'] as $i => $property) { + if (property_exists($item->address, $property)) { + $adminLevels[] = ['name' => $item->address->{$property}, 'level' => $i + 1]; + } + } + $results[] = array_merge($this->getDefaults(), [ 'latitude' => $coordinates[0], 'longitude' => $coordinates[1], @@ -144,8 +150,7 @@ private function executeQuery($query) 'streetName' => $streetName, 'locality' => empty($city) ? null : $city, 'postalCode' => empty($zipcode) ? null : $zipcode, - 'county' => empty($county) ? null : $county, - 'region' => empty($region) ? null : $region, + 'adminLevels' => $adminLevels, 'country' => empty($country) ? null : $country, ]); } diff --git a/src/Geocoder/Provider/FreeGeoIp.php b/src/Geocoder/Provider/FreeGeoIp.php index 12c6853bb..8a1175c83 100644 --- a/src/Geocoder/Provider/FreeGeoIp.php +++ b/src/Geocoder/Provider/FreeGeoIp.php @@ -80,14 +80,23 @@ private function executeQuery($query) $data['region_code'] = is_numeric($newRegionCode) ? $newRegionCode : null; } + $adminLevels = []; + + if (isset($data['region_name']) || isset($data['region_code'])) { + $adminLevels[] = [ + 'name' => isset($data['region_name']) ? $data['region_name'] : null, + 'code' => isset($data['region_code']) ? $data['region_code'] : null, + 'level' => 1 + ]; + } + return $this->returnResults([ array_merge($this->getDefaults(), array( 'latitude' => isset($data['latitude']) ? $data['latitude'] : null, 'longitude' => isset($data['longitude']) ? $data['longitude'] : null, 'locality' => isset($data['city']) ? $data['city'] : null, 'postalCode' => isset($data['zip_code']) ? $data['zip_code'] : null, - 'region' => isset($data['region_name']) ? $data['region_name'] : null, - 'regionCode' => isset($data['region_code']) ? $data['region_code'] : null, + 'adminLevels' => $adminLevels, 'country' => isset($data['country_name']) ? $data['country_name'] : null, 'countryCode' => isset($data['country_code']) ? $data['country_code'] : null, )) diff --git a/src/Geocoder/Provider/GeoIP2.php b/src/Geocoder/Provider/GeoIP2.php index c5135e7b0..15e9daa9c 100644 --- a/src/Geocoder/Provider/GeoIP2.php +++ b/src/Geocoder/Provider/GeoIP2.php @@ -50,14 +50,17 @@ public function geocode($address) $result = json_decode($this->executeQuery($address)); - //Try to extract the region name and code - $region = null; - $regionCode = null; - if (isset($result->subdivisions) && is_array($result->subdivisions) && !empty($result->subdivisions)) { - $lastSubdivision = array_pop($result->subdivisions); - - $region = (isset($lastSubdivision->names->{$this->locale}) ? $lastSubdivision->names->{$this->locale} : null); - $regionCode = (isset($lastSubdivision->iso_code) ? $lastSubdivision->iso_code : null); + $adminLevels = []; + + if (isset($result->subdivisions) && is_array($result->subdivisions)) { + foreach ($result->subdivisions as $i => $subdivision) { + $name = (isset($subdivision->names->{$this->locale}) ? $subdivision->names->{$this->locale} : null); + $code = (isset($subdivision->iso_code) ? $subdivision->iso_code : null); + + if (null !== $name || null !== $code) { + $adminLevels[] = ['name' => $name, 'code' => $code, 'level' => $i + 1]; + } + } } return $this->returnResults([ @@ -69,8 +72,7 @@ public function geocode($address) 'longitude' => (isset($result->location->longitude) ? $result->location->longitude : null), 'timezone' => (isset($result->location->time_zone) ? $result->location->time_zone : null), 'postalCode' => (isset($result->location->postal_code) ? $result->location->postal_code : null), - 'region' => $region, - 'regionCode' => $regionCode + 'adminLevels' => $adminLevels, ))) ]); } diff --git a/src/Geocoder/Provider/GeoIPs.php b/src/Geocoder/Provider/GeoIPs.php index 7a44f42e6..2913236d3 100644 --- a/src/Geocoder/Provider/GeoIPs.php +++ b/src/Geocoder/Provider/GeoIPs.php @@ -165,20 +165,31 @@ private function executeQuery($query) throw new NoResult(sprintf('Invalid response from GeoIPs API for query "%s".', $query)); } - $locations = []; - $location = $response['location']; - $locations[] = array_merge($this->getDefaults(), array( - 'country' => '' === $location['country_name'] ? null : $location['country_name'], - 'countryCode' => '' === $location['country_code'] ? null : $location['country_code'], - 'region' => '' === $location['region_name'] ? null : $location['region_name'], - 'regionCode' => '' === $location['region_code'] ? null : $location['region_code'], - 'county' => '' === $location['county_name'] ? null : $location['county_name'], - 'locality' => '' === $location['city_name'] ? null : $location['city_name'], - 'latitude' => '' === $location['latitude'] ? null : $location['latitude'], - 'longitude' => '' === $location['longitude'] ? null : $location['longitude'], - 'timezone' => '' === $location['timezone'] ? null : $location['timezone'], + $location = array_map(function ($value) { + return '' === $value ? null : $value; + }, $response['location']); + + $adminLevels = []; + + if (null !== $location['region_name'] || null !== $location['region_code']) { + $adminLevels[] = ['name' => $location['region_name'], 'code' => $location['region_code'], 'level' => 1]; + } + + if (null !== $location['county_name']) { + $adminLevels[] = ['name' => $location['county_name'], 'level' => 2]; + } + + $results = []; + $results[] = array_merge($this->getDefaults(), array( + 'country' => $location['country_name'], + 'countryCode' => $location['country_code'], + 'adminLevels' => $adminLevels, + 'locality' => $location['city_name'], + 'latitude' => $location['latitude'], + 'longitude' => $location['longitude'], + 'timezone' => $location['timezone'], )); - return $this->returnResults($locations); + return $this->returnResults($results); } } diff --git a/src/Geocoder/Provider/GeoPlugin.php b/src/Geocoder/Provider/GeoPlugin.php index 38de9c295..efe2172d0 100644 --- a/src/Geocoder/Provider/GeoPlugin.php +++ b/src/Geocoder/Provider/GeoPlugin.php @@ -80,13 +80,21 @@ private function executeQuery($query) $data = array_filter($json); + $adminLevels = []; + + $region = \igorw\get_in($data, ['geoplugin_regionName']); + $regionCode = \igorw\get_in($data, ['geoplugin_regionCode']); + + if (null !== $region || null !== $regionCode) { + $adminLevels[] = ['name' => $region, 'code' => $regionCode, 'level' => 1]; + } + $results = []; $results[] = array_merge($this->getDefaults(), [ 'locality' => isset($data['geoplugin_city']) ? $data['geoplugin_city'] : null, 'country' => isset($data['geoplugin_countryName']) ? $data['geoplugin_countryName'] : null, 'countryCode' => isset($data['geoplugin_countryCode']) ? $data['geoplugin_countryCode'] : null, - 'region' => isset($data['geoplugin_regionName']) ? $data['geoplugin_regionName'] : null, - 'regionCode' => isset($data['geoplugin_regionCode']) ? $data['geoplugin_regionCode'] : null, + 'adminLevels' => $adminLevels, 'latitude' => isset($data['geoplugin_latitude']) ? $data['geoplugin_latitude'] : null, 'longitude' => isset($data['geoplugin_longitude']) ? $data['geoplugin_longitude'] : null, ]); diff --git a/src/Geocoder/Provider/Geoip.php b/src/Geocoder/Provider/Geoip.php index 76586ddd2..4ce81dce5 100644 --- a/src/Geocoder/Provider/Geoip.php +++ b/src/Geocoder/Provider/Geoip.php @@ -63,8 +63,7 @@ public function geocode($address) 'longitude' => $results['longitude'], 'locality' => $results['city'], 'postalCode' => $results['postal_code'], - 'region' => $region, - 'regionCode' => $results['region'], + 'adminLevels' => $results['region'] ? [['name' => $region, 'code' => $results['region'], 'level' => 1]] : [], 'country' => $results['country_name'], 'countryCode' => $results['country_code'], 'timezone' => $timezone, diff --git a/src/Geocoder/Provider/Geonames.php b/src/Geocoder/Provider/Geonames.php index b219f5a32..c7fe3425f 100644 --- a/src/Geocoder/Provider/Geonames.php +++ b/src/Geocoder/Provider/Geonames.php @@ -13,6 +13,7 @@ use Geocoder\Exception\InvalidCredentials; use Geocoder\Exception\NoResult; use Geocoder\Exception\UnsupportedOperation; +use Geocoder\Model\AdminLevelCollection; use Ivory\HttpAdapter\HttpAdapterInterface; /** @@ -134,13 +135,26 @@ private function executeQuery($query) ); } + $adminLevels = []; + + for ($level = 1; $level <= AdminLevelCollection::MAX_LEVEL_DEPTH; ++ $level) { + $adminNameProp = 'adminName' . $level; + $adminCodeProp = 'adminCode' . $level; + if (! empty($item->$adminNameProp) || ! empty($item->$adminCodeProp)) { + $adminLevels[] = [ + 'name' => empty($item->$adminNameProp) ? null : $item->$adminNameProp , + 'code' => empty($item->$adminCodeProp) ? null : $item->$adminCodeProp, + 'level' => $level, + ]; + } + } + $results[] = array_merge($this->getDefaults(), [ 'latitude' => isset($item->lat) ? $item->lat : null, 'longitude' => isset($item->lng) ? $item->lng : null, 'bounds' => $bounds, 'locality' => isset($item->name) ? $item->name : null, - 'county' => isset($item->adminName2) ? $item->adminName2 : null, - 'region' => isset($item->adminName1) ? $item->adminName1 : null, + 'adminLevels' => $adminLevels, 'country' => isset($item->countryName) ? $item->countryName : null, 'countryCode' => isset($item->countryCode) ? $item->countryCode : null, 'timezone' => isset($item->timezone->timeZoneId) ? $item->timezone->timeZoneId : null, diff --git a/src/Geocoder/Provider/GoogleMaps.php b/src/Geocoder/Provider/GoogleMaps.php index 8d5de8879..3b8ba8b8d 100644 --- a/src/Geocoder/Provider/GoogleMaps.php +++ b/src/Geocoder/Provider/GoogleMaps.php @@ -227,14 +227,16 @@ private function updateAddressComponent(&$resultSet, $type, $values) $resultSet['locality'] = $values->long_name; break; - case 'administrative_area_level_2': - $resultSet['county'] = $values->long_name; - $resultSet['countyCode'] = $values->short_name; - break; - case 'administrative_area_level_1': - $resultSet['region'] = $values->long_name; - $resultSet['regionCode'] = $values->short_name; + case 'administrative_area_level_2': + case 'administrative_area_level_3': + case 'administrative_area_level_4': + case 'administrative_area_level_5': + $resultSet['adminLevels'][]= [ + 'name' => $values->long_name, + 'code' => $values->short_name, + 'level' => intval(substr($type, -1)) + ]; break; case 'country': diff --git a/src/Geocoder/Provider/IpInfoDb.php b/src/Geocoder/Provider/IpInfoDb.php index 7e409f0c5..a2ab2dc76 100644 --- a/src/Geocoder/Provider/IpInfoDb.php +++ b/src/Geocoder/Provider/IpInfoDb.php @@ -144,7 +144,7 @@ private function executeQuery($query) 'longitude' => isset($data['longitude']) ? $data['longitude'] : null, 'locality' => isset($data['cityName']) ? $data['cityName'] : null, 'postalCode' => isset($data['zipCode']) ? $data['zipCode'] : null, - 'region' => isset($data['regionName']) ? $data['regionName'] : null, + 'adminLevels' => isset($data['regionName']) ? [['name' => $data['regionName'], 'level' => 1]] : [], 'country' => isset($data['countryName']) ? $data['countryName'] : null, 'countryCode' => isset($data['countryName']) ? $data['countryCode'] : null, 'timezone' => $timezone, diff --git a/src/Geocoder/Provider/MapQuest.php b/src/Geocoder/Provider/MapQuest.php index 2049e28eb..6d675311c 100644 --- a/src/Geocoder/Provider/MapQuest.php +++ b/src/Geocoder/Provider/MapQuest.php @@ -141,15 +141,24 @@ private function executeQuery($query) $results = []; foreach ($locations as $location) { if ($location['street'] || $location['postalCode'] || $location['adminArea5'] || $location['adminArea4'] || $location['adminArea3'] || $location['adminArea1']) { + $admins = []; + + if ($location['adminArea3']) { + $admins[] = ['name' => $location['adminArea3'], 'level' => 1]; + } + + if ($location['adminArea4']) { + $admins[] = ['name' => $location['adminArea4'], 'level' => 2]; + } + $results[] = array_merge($this->getDefaults(), array( - 'latitude' => $location['latLng']['lat'], - 'longitude' => $location['latLng']['lng'], - 'streetName' => $location['street'] ?: null, - 'locality' => $location['adminArea5'] ?: null, - 'postalCode' => $location['postalCode'] ?: null, - 'county' => $location['adminArea4'] ?: null, - 'region' => $location['adminArea3'] ?: null, - 'country' => $location['adminArea1'] ?: null, + 'latitude' => $location['latLng']['lat'], + 'longitude' => $location['latLng']['lng'], + 'streetName' => $location['street'] ?: null, + 'locality' => $location['adminArea5'] ?: null, + 'postalCode' => $location['postalCode'] ?: null, + 'adminLevels' => $admins, + 'country' => $location['adminArea1'] ?: null, )); } } diff --git a/src/Geocoder/Provider/MaxMind.php b/src/Geocoder/Provider/MaxMind.php index ff96b0b61..5b5ffee3e 100644 --- a/src/Geocoder/Provider/MaxMind.php +++ b/src/Geocoder/Provider/MaxMind.php @@ -146,6 +146,8 @@ private function executeQuery($query) $data['country'] = $this->countryCodeToCountryName($data['countryCode']); } + $data = $this->replaceAdmins($data); + return $this->returnResults([ $this->fixEncoding(array_merge($this->getDefaults(), $data)) ]); @@ -158,6 +160,23 @@ private function countryCodeToCountryName($code) return $countryNames[$code]; } + private function replaceAdmins($data) + { + $adminLevels = []; + + $region = \igorw\get_in($data, ['region']); + $regionCode = \igorw\get_in($data, ['regionCode']); + unset($data['region'], $data['regionCode']); + + if (null !== $region || null !== $regionCode) { + $adminLevels[] = ['name' => $region, 'code' => $regionCode, 'level' => 1]; + } + + $data['adminLevels'] = $adminLevels; + + return $data; + } + /** * We do not support Country and City services because they do not return much fields. * @see http://dev.maxmind.com/geoip/web-services diff --git a/src/Geocoder/Provider/MaxMindBinary.php b/src/Geocoder/Provider/MaxMindBinary.php index 9337ae317..c7a7d19dd 100644 --- a/src/Geocoder/Provider/MaxMindBinary.php +++ b/src/Geocoder/Provider/MaxMindBinary.php @@ -87,11 +87,17 @@ public function geocode($address) throw new NoResult(sprintf('No results found for IP address %s', $address)); } + $adminLevels = []; + + if ($geoIpRecord->region) { + $adminLevels[] = ['name' => $geoIpRecord->region, 'level' => 1]; + } + return $this->returnResults([ $this->fixEncoding(array_merge($this->getDefaults(), [ 'countryCode' => $geoIpRecord->country_code, 'country' => $geoIpRecord->country_name, - 'region' => $geoIpRecord->region, + 'adminLevels' => $adminLevels, 'locality' => $geoIpRecord->city, 'latitude' => $geoIpRecord->latitude, 'longitude' => $geoIpRecord->longitude, diff --git a/src/Geocoder/Provider/Nominatim.php b/src/Geocoder/Provider/Nominatim.php index 746502950..7bb0590f8 100644 --- a/src/Geocoder/Provider/Nominatim.php +++ b/src/Geocoder/Provider/Nominatim.php @@ -74,25 +74,7 @@ public function geocode($address) $results = []; foreach ($places as $place) { - $boundsAttr = $place->getAttribute('boundingbox'); - $bounds = []; - - list($bounds['south'], $bounds['north'], $bounds['west'], $bounds['east']) = $boundsAttr ? explode(',', $boundsAttr) : null; - - $results[] = array_merge($this->getDefaults(), array( - 'latitude' => $place->getAttribute('lat'), - 'longitude' => $place->getAttribute('lon'), - 'bounds' => $bounds, - 'postalCode' => $this->getNodeValue($place->getElementsByTagName('postcode')), - 'county' => $this->getNodeValue($place->getElementsByTagName('county')), - 'region' => $this->getNodeValue($place->getElementsByTagName('state')), - 'streetNumber' => $this->getNodeValue($place->getElementsByTagName('house_number')), - 'streetName' => $this->getNodeValue($place->getElementsByTagName('road')) ?: $this->getNodeValue($place->getElementsByTagName('pedestrian')), - 'locality' => $this->getNodeValue($place->getElementsByTagName('city')), - 'subLocality' => $this->getNodeValue($place->getElementsByTagName('suburb')), - 'country' => $this->getNodeValue($place->getElementsByTagName('country')), - 'countryCode' => strtoupper($this->getNodeValue($place->getElementsByTagName('country_code'))), - )); + $results[] = array_merge($this->getDefaults(), $this->xmlResultToArray($place, $place)); } return $this->returnResults($results); @@ -120,22 +102,45 @@ public function reverse($latitude, $longitude) $result = $searchResult->getElementsByTagName('result')->item(0); return $this->returnResults([ - array_merge($this->getDefaults(), [ - 'latitude' => $result->getAttribute('lat'), - 'longitude' => $result->getAttribute('lon'), - 'postalCode' => $this->getNodeValue($addressParts->getElementsByTagName('postcode')), - 'county' => $this->getNodeValue($addressParts->getElementsByTagName('county')), - 'region' => $this->getNodeValue($addressParts->getElementsByTagName('state')), - 'streetNumber' => $this->getNodeValue($addressParts->getElementsByTagName('house_number')), - 'streetName' => $this->getNodeValue($addressParts->getElementsByTagName('road')) ?: $this->getNodeValue($addressParts->getElementsByTagName('pedestrian')), - 'locality' => $this->getNodeValue($addressParts->getElementsByTagName('city')), - 'subLocality' => $this->getNodeValue($addressParts->getElementsByTagName('suburb')), - 'country' => $this->getNodeValue($addressParts->getElementsByTagName('country')), - 'countryCode' => strtoupper($this->getNodeValue($addressParts->getElementsByTagName('country_code'))), - ]) + array_merge($this->getDefaults(), $this->xmlResultToArray($result, $addressParts)) ]); } + private function xmlResultToArray(\DOMElement $resultNode, \DOMElement $addressNode) + { + $adminLevels = []; + + foreach (['state', 'county'] as $i => $tagName) { + if (null !== ($adminLevel = $this->getNodeValue($addressNode->getElementsByTagName($tagName)))) { + $adminLevels[] = ['name' => $adminLevel, 'level' => $i + 1]; + } + } + + $result = [ + 'latitude' => $resultNode->getAttribute('lat'), + 'longitude' => $resultNode->getAttribute('lon'), + 'postalCode' => $this->getNodeValue($addressNode->getElementsByTagName('postcode')), + 'adminLevels' => $adminLevels, + 'streetNumber' => $this->getNodeValue($addressNode->getElementsByTagName('house_number')), + 'streetName' => $this->getNodeValue($addressNode->getElementsByTagName('road')) ?: $this->getNodeValue($addressNode->getElementsByTagName('pedestrian')), + 'locality' => $this->getNodeValue($addressNode->getElementsByTagName('city')), + 'subLocality' => $this->getNodeValue($addressNode->getElementsByTagName('suburb')), + 'country' => $this->getNodeValue($addressNode->getElementsByTagName('country')), + 'countryCode' => strtoupper($this->getNodeValue($addressNode->getElementsByTagName('country_code'))), + ]; + + $boundsAttr = $resultNode->getAttribute('boundingbox'); + if ($boundsAttr) { + $bounds = []; + + list($bounds['south'], $bounds['north'], $bounds['west'], $bounds['east']) = explode(',', $boundsAttr); + + $result['bounds'] = $bounds; + } + + return $result; + } + /** * {@inheritDoc} */ diff --git a/src/Geocoder/Provider/OpenCage.php b/src/Geocoder/Provider/OpenCage.php index 9fb00e14f..c8e7c3b1c 100644 --- a/src/Geocoder/Provider/OpenCage.php +++ b/src/Geocoder/Provider/OpenCage.php @@ -128,7 +128,15 @@ private function executeQuery($query) ]; } - $comp = $location['components']; + $comp = $location['components']; + + $adminLevels = []; + foreach (['state', 'county'] as $i => $component) { + if (isset($comp[$component])) { + $adminLevels[] = ['name' => $comp[$component], 'level' => $i + 1]; + } + } + $results[] = array_merge($this->getDefaults(), array( 'latitude' => $location['geometry']['lat'], 'longitude' => $location['geometry']['lng'], @@ -138,8 +146,7 @@ private function executeQuery($query) 'subLocality' => isset($comp['suburb'] ) ? $comp['suburb'] : null, 'locality' => isset($comp['city'] ) ? $comp['city'] : null, 'postalCode' => isset($comp['postcode'] ) ? $comp['postcode'] : null, - 'county' => isset($comp['county'] ) ? $comp['county'] : null, - 'region' => isset($comp['state'] ) ? $comp['state'] : null, + 'adminLevels' => $adminLevels, 'country' => isset($comp['country'] ) ? $comp['country'] : null, 'countryCode' => isset($comp['country_code']) ? strtoupper($comp['country_code']) : null, 'timezone' => isset($location['annotations']['timezone']['name']) ? $location['annotations']['timezone']['name'] : null, diff --git a/src/Geocoder/Provider/TomTom.php b/src/Geocoder/Provider/TomTom.php index 8d1593cf7..fefec969f 100644 --- a/src/Geocoder/Provider/TomTom.php +++ b/src/Geocoder/Provider/TomTom.php @@ -150,7 +150,7 @@ private function getResultArray(\SimpleXmlElement $data) 'longitude' => isset($data->longitude) ? (double) $data->longitude : null, 'streetName' => isset($data->street) ? (string) $data->street : null, 'locality' => isset($data->city) ? (string) $data->city : null, - 'region' => isset($data->state) ? (string) $data->state : null, + 'adminLevels' => isset($data->state) ? [['name' => (string) $data->state, 'level' => 1]] : [], 'country' => isset($data->country) ? (string) $data->country : null, 'countryCode' => isset($data->countryISO3) ? (string) $data->countryISO3 : null, )); diff --git a/src/Geocoder/Provider/Yandex.php b/src/Geocoder/Provider/Yandex.php index f65f06c2c..cb6512bb2 100644 --- a/src/Geocoder/Provider/Yandex.php +++ b/src/Geocoder/Provider/Yandex.php @@ -134,6 +134,12 @@ function ($value, $key) use (&$details) {$details[$key] = $value;} $coordinates = explode(' ', $details['pos']); + $adminLevels = []; + + if (isset($details['AdministrativeAreaName'])) { + $adminLevels[] = ['name' => $details['AdministrativeAreaName'], 'level' => 1]; + } + $results[] = array_merge($this->getDefaults(), array( 'latitude' => $coordinates[1], 'longitude' => $coordinates[0], @@ -142,7 +148,7 @@ function ($value, $key) use (&$details) {$details[$key] = $value;} 'streetName' => isset($details['ThoroughfareName']) ? $details['ThoroughfareName'] : null, 'subLocality' => isset($details['DependentLocalityName']) ? $details['DependentLocalityName'] : null, 'locality' => isset($details['LocalityName']) ? $details['LocalityName'] : null, - 'region' => isset($details['AdministrativeAreaName']) ? $details['AdministrativeAreaName'] : null, + 'adminLevels' => $adminLevels, 'country' => isset($details['CountryName']) ? $details['CountryName'] : null, 'countryCode' => isset($details['CountryNameCode']) ? $details['CountryNameCode'] : null, )); diff --git a/tests/Geocoder/Tests/Formatter/StringFormatterTest.php b/tests/Geocoder/Tests/Formatter/StringFormatterTest.php index 2f3cae0c5..46a85bd49 100644 --- a/tests/Geocoder/Tests/Formatter/StringFormatterTest.php +++ b/tests/Geocoder/Tests/Formatter/StringFormatterTest.php @@ -53,23 +53,23 @@ public static function dataProviderForTestFormat() '8001' ), array( - array('county' => 'Collin County'), - '%P', + array('adminLevels' => [['name' => 'Collin County', 'level' => 2]]), + '%A2', 'Collin County' ), array( - array('countyCode' => 'FC'), - '%p', + array('adminLevels' => [['code' => 'FC', 'level' => 2]]), + '%a2', 'FC' ), array( - array('region' => 'Auvergne'), - '%R', + array('adminLevels' => [['name' => 'Auvergne', 'level' => 1]]), + '%A1', 'Auvergne' ), array( - array('regionCode' => 'CA'), - '%r', + array('adminLevels' => [['code' => 'CA', 'level' => 1]]), + '%a1', 'CA' ), array( @@ -119,7 +119,7 @@ public static function dataProviderForTestFormat() 'postalCode' => 8001, 'locality' => 'Zuerich', ), - '

%S %n, %z %L

%P

', + '

%S %n, %z %L

%A2

', '

Badenerstrasse 120, 8001 Zuerich

' ), ); diff --git a/tests/Geocoder/Tests/Model/AddressFactoryTest.php b/tests/Geocoder/Tests/Model/AddressFactoryTest.php index d9ddda00f..db5ce10db 100644 --- a/tests/Geocoder/Tests/Model/AddressFactoryTest.php +++ b/tests/Geocoder/Tests/Model/AddressFactoryTest.php @@ -23,8 +23,8 @@ public function testCreateFromArray() $addresses = $this->factory->createFromArray([ [ 'streetNumber' => 1 ], - [ 'streetNumber' => 2 ], - [ 'streetNumber' => 3 ], + [ 'streetNumber' => 2, 'adminLevels' => [['name' => 'admin 1', 'level' => 1]] ], + [ 'streetNumber' => 3, 'adminLevels' => [['name' => 'admin 2', 'level' => 2], ['name' => 'admin 1', 'level' => 1]] ], ]); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $addresses); @@ -33,10 +33,14 @@ public function testCreateFromArray() $i = 1; foreach ($addresses as $address) { $this->assertInstanceOf('Geocoder\Model\Address', $address); - $this->assertNull($address->getCoordinates()); - $this->assertInstanceOf('Geocoder\Model\County', $address->getCounty()); $this->assertInstanceOf('Geocoder\Model\Country', $address->getCountry()); - $this->assertInstanceOf('Geocoder\Model\Region', $address->getRegion()); + $this->assertNull($address->getCoordinates()); + + foreach ($address->getAdminLevels() as $level => $adminLevel) { + $this->assertInstanceOf('Geocoder\Model\AdminLevel', $adminLevel); + $this->assertSame($level, $adminLevel->getLevel()); + $this->assertEquals('admin ' . $level, $adminLevel->getName()); + } $this->assertEquals($i++, $address->getStreetNumber()); } diff --git a/tests/Geocoder/Tests/Provider/AbstractProviderTest.php b/tests/Geocoder/Tests/Provider/AbstractProviderTest.php index 18909996d..5a11a8017 100644 --- a/tests/Geocoder/Tests/Provider/AbstractProviderTest.php +++ b/tests/Geocoder/Tests/Provider/AbstractProviderTest.php @@ -21,8 +21,6 @@ public function testGetLocalhostDefaults() $this->assertEquals(4, count($result)); $this->assertEquals('localhost', $result['locality']); - $this->assertEquals('localhost', $result['region']); - $this->assertEquals('localhost', $result['county']); $this->assertEquals('localhost', $result['country']); } } diff --git a/tests/Geocoder/Tests/Provider/ArcGISOnlineTest.php b/tests/Geocoder/Tests/Provider/ArcGISOnlineTest.php index ee29ec046..db69cd09b 100644 --- a/tests/Geocoder/Tests/Provider/ArcGISOnlineTest.php +++ b/tests/Geocoder/Tests/Provider/ArcGISOnlineTest.php @@ -89,14 +89,15 @@ public function testGeocodeWithRealAddress() $this->assertEquals('10 Avenue Gambetta, 75020, 20e Arrondissement, Paris, Île-de-France', $result->getStreetName()); $this->assertEquals(75020, $result->getPostalCode()); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Île-de-France', $result->getRegion()->getName()); - $this->assertEquals('Paris', $result->getCounty()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Île-de-France', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('Paris', $result->getAdminLevels()->get(2)->getName()); $this->assertEquals('FRA', $result->getCountry()->getCode()); $this->assertFalse($result->getBounds()->isDefined()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getCounty()->getCode()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertNull($result->getAdminLevels()->get(2)->getCode()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getCountry()->getName()); $this->assertNull($result->getTimezone()); } @@ -118,15 +119,16 @@ public function testGeocodeWithRealAddressAndHttps() $this->assertEquals('10 Avenue Gambetta, 75020, 20e Arrondissement, Paris, Île-de-France', $result->getStreetName()); $this->assertEquals(75020, $result->getPostalCode()); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Paris', $result->getCounty()->getName()); - $this->assertEquals('Île-de-France', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Paris', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Île-de-France', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('FRA', $result->getCountry()->getCode()); $this->assertEquals(10, $result->getStreetNumber()); $this->assertFalse($result->getBounds()->isDefined()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getCounty()->getCode()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertNull($result->getAdminLevels()->get(2)->getCode()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getCountry()->getName()); $this->assertNull($result->getTimezone()); } @@ -188,14 +190,11 @@ public function testReverseWithRealCoordinates() $this->assertEquals('3 Avenue Gambetta', $result->getStreetName()); $this->assertEquals(75020, $result->getPostalCode()); $this->assertEquals('Paris', $result->getLocality()); - $this->assertNull($result->getCounty()->getName()); - $this->assertNull($result->getRegion()->getName()); $this->assertEquals('FRA', $result->getCountry()->getCode()); $this->assertFalse($result->getBounds()->isDefined()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getCounty()->getCode()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertEmpty($result->getAdminLevels()); $this->assertNull($result->getCountry()->getName()); $this->assertNull($result->getTimezone()); } @@ -217,14 +216,11 @@ public function testReverseWithRealCoordinatesWithHttps() $this->assertEquals('3 Avenue Gambetta', $result->getStreetName()); $this->assertEquals(75020, $result->getPostalCode()); $this->assertEquals('Paris', $result->getLocality()); - $this->assertNull($result->getCounty()->getName()); - $this->assertNull($result->getRegion()->getName()); $this->assertEquals('FRA', $result->getCountry()->getCode()); $this->assertFalse($result->getBounds()->isDefined()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getCounty()->getCode()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertEmpty($result->getAdminLevels()); $this->assertNull($result->getCountry()->getName()); $this->assertNull($result->getTimezone()); } @@ -246,14 +242,12 @@ public function testGeocodeWithCity() $this->assertEquals('Hannover, Niedersachsen, Deutschland', $result->getStreetName()); $this->assertNull($result->getPostalCode()); $this->assertNull($result->getLocality()); - $this->assertNull($result->getCounty()->getName()); - $this->assertEquals('Niedersachsen', $result->getRegion()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Niedersachsen', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('DEU', $result->getCountry()->getCode()); $this->assertFalse($result->getBounds()->isDefined()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getCounty()->getCode()); - $this->assertNull($result->getRegion()->getCode()); $this->assertNull($result->getCountry()->getName()); $this->assertNull($result->getTimezone()); @@ -264,7 +258,8 @@ public function testGeocodeWithCity() $this->assertEquals(-101.4265391569997, $result->getLongitude(), '', 0.0001); $this->assertEquals('Hannover, North Dakota, United States', $result->getStreetName()); $this->assertNull($result->getLocality()); - $this->assertEquals('North Dakota', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('North Dakota', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('USA', $result->getCountry()->getCode()); /** @var \Geocoder\Model\Address $result */ @@ -274,7 +269,8 @@ public function testGeocodeWithCity() $this->assertEquals(-77.440257128999633, $result->getLongitude(), '', 0.0001); $this->assertEquals('Hannover, Maryland, United States', $result->getStreetName()); $this->assertNull($result->getLocality()); - $this->assertEquals('Maryland', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Maryland', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('USA', $result->getCountry()->getCode()); /** @var \Geocoder\Model\Address $result */ @@ -284,8 +280,8 @@ public function testGeocodeWithCity() $this->assertEquals(8.5069383810005, $result->getLongitude(), '', 0.0001); $this->assertEquals('Hannöver, Niedersachsen, Deutschland', $result->getStreetName()); $this->assertNull($result->getLocality()); - $this->assertEquals('Niedersachsen', $result->getRegion()->getName()); - $this->assertNull($result->getCounty()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Niedersachsen', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('DEU', $result->getCountry()->getCode()); /** @var \Geocoder\Model\Address $result */ @@ -294,7 +290,8 @@ public function testGeocodeWithCity() $this->assertEquals(-26.281805980999593, $result->getLatitude(), '', 0.0001); $this->assertEquals(-48.849389793999649, $result->getLongitude(), '', 0.0001); $this->assertEquals('Hannover', $result->getStreetName()); - $this->assertEquals('Sul', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Sul', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('BRA', $result->getCountry()->getCode()); } diff --git a/tests/Geocoder/Tests/Provider/BingMapsTest.php b/tests/Geocoder/Tests/Provider/BingMapsTest.php index bcb26cfa9..fb46456e7 100644 --- a/tests/Geocoder/Tests/Provider/BingMapsTest.php +++ b/tests/Geocoder/Tests/Provider/BingMapsTest.php @@ -108,8 +108,9 @@ public function testGeocodeReturnsMultipleResults() $this->assertEquals('10 Avenue Gambetta', $result->getStreetName()); $this->assertEquals(75020, $result->getPostalCode()); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Paris', $result->getCounty()->getName()); - $this->assertEquals('IdF', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Paris', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('IdF', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('France', $result->getCountry()->getName()); $this->assertNull($result->getCountry()->getCode()); @@ -129,8 +130,9 @@ public function testGeocodeReturnsMultipleResults() $this->assertEquals('10 Avenue Léon Gambetta', $result->getStreetName()); $this->assertEquals(92120, $result->getPostalCode()); $this->assertEquals('Montrouge', $result->getLocality()); - $this->assertEquals('Hauts-de-Seine', $result->getCounty()->getName()); - $this->assertEquals('IdF', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Hauts-de-Seine', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('IdF', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('France', $result->getCountry()->getName()); /** @var \Geocoder\Model\Address $result */ @@ -147,8 +149,9 @@ public function testGeocodeReturnsMultipleResults() $this->assertEquals('10 Avenue Gambetta', $result->getStreetName()); $this->assertEquals(94700, $result->getPostalCode()); $this->assertEquals('Maisons-Alfort', $result->getLocality()); - $this->assertEquals('Val-De-Marne', $result->getCounty()->getName()); - $this->assertEquals('IdF', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Val-De-Marne', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('IdF', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('France', $result->getCountry()->getName()); } @@ -178,15 +181,16 @@ public function testReverseReturnsSingleResult() $this->assertEquals('10 Avenue Gambetta', $result->getStreetName()); $this->assertEquals(75020, $result->getPostalCode()); $this->assertEquals('20e Arrondissement', $result->getLocality()); - $this->assertEquals('Paris', $result->getCounty()->getName()); - $this->assertEquals('IdF', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Paris', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('IdF', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('France', $result->getCountry()->getName()); $this->assertNull($result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); } - public function testGeocodeWithRealAddressReturnsMultipleResults() + public function testGeocodeWithRealAddressReturnsSingleResults() { if (!isset($_SERVER['BINGMAPS_API_KEY'])) { $this->markTestSkipped('You need to configure the BINGMAPS_API_KEY value in phpunit.xml'); @@ -196,7 +200,7 @@ public function testGeocodeWithRealAddressReturnsMultipleResults() $results = $provider->geocode('10 avenue Gambetta, Paris, France'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); - $this->assertCount(3, $results); + $this->assertCount(1, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); @@ -212,48 +216,124 @@ public function testGeocodeWithRealAddressReturnsMultipleResults() $this->assertEquals('10 Avenue Gambetta', $result->getStreetName()); $this->assertEquals(75020, $result->getPostalCode()); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Paris', $result->getCounty()->getName()); - $this->assertEquals('IdF', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Paris', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('IdF', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('France', $result->getCountry()->getName()); + $this->assertNull($result->getAdminLevels()->get(2)->getCode()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); + } + + public function testGeocodeWithRealAddressReturnsMultipleResults() + { + if (!isset($_SERVER['BINGMAPS_API_KEY'])) { + $this->markTestSkipped('You need to configure the BINGMAPS_API_KEY value in phpunit.xml'); + } + + $provider = new BingMaps($this->getAdapter(), $_SERVER['BINGMAPS_API_KEY'], 'fr-FR'); + $results = $provider->geocode('Castelnuovo, Italie'); + + $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertCount(5, $results); + + /** @var \Geocoder\Model\Address $result */ + $result = $results->get(0); + $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertEquals(44.786701202393, $result->getLatitude(), '', 0.01); + $this->assertEquals(8.2841901779175, $result->getLongitude(), '', 0.01); + $this->assertTrue($result->getBounds()->isDefined()); + $this->assertEquals(44.775325775146, $result->getBounds()->getSouth(), '', 0.01); + $this->assertEquals(8.2711343765259, $result->getBounds()->getWest(), '', 0.01); + $this->assertEquals(44.795879364014, $result->getBounds()->getNorth(), '', 0.01); + $this->assertEquals(8.296314239502, $result->getBounds()->getEast(), '', 0.01); + $this->assertNull($result->getStreetNumber()); + $this->assertEmpty($result->getStreetName()); + $this->assertEmpty($result->getPostalCode()); + $this->assertEquals('Castelnuovo Calcea', $result->getLocality()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('AT', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Piem.', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('Italie', $result->getCountry()->getName()); + /** @var \Geocoder\Model\Address $result */ $result = $results->get(1); $this->assertInstanceOf('\Geocoder\Model\Address', $result); - $this->assertEquals(48.81342781, $result->getLatitude(), '', 0.01); - $this->assertEquals(2.32503767, $result->getLongitude(), '', 0.01); + $this->assertEquals(46.05179977417, $result->getLatitude(), '', 0.01); + $this->assertEquals(11.497699737549, $result->getLongitude(), '', 0.01); $this->assertTrue($result->getBounds()->isDefined()); - $this->assertEquals(48.809565092429, $result->getBounds()->getSouth(), '', 0.01); - $this->assertEquals(2.3172171827738, $result->getBounds()->getWest(), '', 0.01); - $this->assertEquals(48.817290527571, $result->getBounds()->getNorth(), '', 0.01); - $this->assertEquals(2.3328581572262, $result->getBounds()->getEast(), '', 0.01); + $this->assertEquals(46.029235839844, $result->getBounds()->getSouth(), '', 0.01); + $this->assertEquals(11.473880767822, $result->getBounds()->getWest(), '', 0.01); + $this->assertEquals(46.07377243042, $result->getBounds()->getNorth(), '', 0.01); + $this->assertEquals(11.51912689209, $result->getBounds()->getEast(), '', 0.01); $this->assertNull($result->getStreetNumber()); - $this->assertEquals('10 Avenue Léon Gambetta', $result->getStreetName()); - $this->assertEquals(92120, $result->getPostalCode()); - $this->assertEquals('Montrouge', $result->getLocality()); - $this->assertEquals('Hauts-de-Seine', $result->getCounty()->getName()); - $this->assertEquals('IdF', $result->getRegion()->getName()); - $this->assertEquals('France', $result->getCountry()->getName()); + $this->assertEmpty($result->getStreetName()); + $this->assertEmpty($result->getPostalCode()); + $this->assertEquals('Castelnuovo', $result->getLocality()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('TN', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Tr.A.A.', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('Italie', $result->getCountry()->getName()); /** @var \Geocoder\Model\Address $result */ $result = $results->get(2); $this->assertInstanceOf('\Geocoder\Model\Address', $result); - $this->assertEquals(48.81014147, $result->getLatitude(), '', 0.01); - $this->assertEquals(2.43568048, $result->getLongitude(), '', 0.01); + $this->assertEquals(44.987880706787, $result->getLatitude(), '', 0.01); + $this->assertEquals(9.442440032959, $result->getLongitude(), '', 0.01); $this->assertTrue($result->getBounds()->isDefined()); - $this->assertEquals(48.806278752429, $result->getBounds()->getSouth(), '', 0.01); - $this->assertEquals(2.4278605052897, $result->getBounds()->getWest(), '', 0.01); - $this->assertEquals(48.814004187571, $result->getBounds()->getNorth(), '', 0.01); - $this->assertEquals(2.4435004547103, $result->getBounds()->getEast(), '', 0.01); + $this->assertEquals(44.958910323795, $result->getBounds()->getSouth(), '', 0.01); + $this->assertEquals(9.3878520826907, $result->getBounds()->getWest(), '', 0.01); + $this->assertEquals(45.01685108978, $result->getBounds()->getNorth(), '', 0.01); + $this->assertEquals(9.4970279832272, $result->getBounds()->getEast(), '', 0.01); $this->assertNull($result->getStreetNumber()); - $this->assertEquals('10 Avenue Gambetta', $result->getStreetName()); - $this->assertEquals(94700, $result->getPostalCode()); - $this->assertEquals('Maisons-Alfort', $result->getLocality()); - $this->assertEquals('Val-de-Marne', $result->getCounty()->getName()); - $this->assertEquals('IdF', $result->getRegion()->getName()); - $this->assertEquals('France', $result->getCountry()->getName()); + $this->assertEmpty($result->getStreetName()); + $this->assertEmpty($result->getPostalCode()); + $this->assertEquals('Castelnuovo', $result->getLocality()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('PC', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Em.Rom.', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('Italie', $result->getCountry()->getName()); + + /** @var \Geocoder\Model\Address $result */ + $result = $results->get(3); + $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertEquals(43.82638168335, $result->getLatitude(), '', 0.01); + $this->assertEquals(11.068260192871, $result->getLongitude(), '', 0.01); + $this->assertTrue($result->getBounds()->isDefined()); + $this->assertEquals(43.797411300357, $result->getBounds()->getSouth(), '', 0.01); + $this->assertEquals(11.014744487393, $result->getBounds()->getWest(), '', 0.01); + $this->assertEquals(43.855352066342, $result->getBounds()->getNorth(), '', 0.01); + $this->assertEquals(11.121775898349, $result->getBounds()->getEast(), '', 0.01); + $this->assertNull($result->getStreetNumber()); + $this->assertEmpty($result->getStreetName()); + $this->assertEmpty($result->getPostalCode()); + $this->assertEquals('Castelnuovo', $result->getLocality()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('PO', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Tosc.', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('Italie', $result->getCountry()->getName()); + + /** @var \Geocoder\Model\Address $result */ + $result = $results->get(4); + $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertEquals(42.295810699463, $result->getLatitude(), '', 0.01); + $this->assertEquals(13.626440048218, $result->getLongitude(), '', 0.01); + $this->assertTrue($result->getBounds()->isDefined()); + $this->assertEquals(42.26684031647, $result->getBounds()->getSouth(), '', 0.01); + $this->assertEquals(13.574242599134, $result->getBounds()->getWest(), '', 0.01); + $this->assertEquals(42.324781082455, $result->getBounds()->getNorth(), '', 0.01); + $this->assertEquals(13.678637497301, $result->getBounds()->getEast(), '', 0.01); + $this->assertNull($result->getStreetNumber()); + $this->assertEmpty($result->getStreetName()); + $this->assertEmpty($result->getPostalCode()); + $this->assertEquals('Castelnuovo', $result->getLocality()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('AQ', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Abr.', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('Italie', $result->getCountry()->getName()); } /** @@ -302,8 +382,9 @@ public function testReverseWithRealCoordinatesReturnsSingleResult() $this->assertEquals('10 Avenue Gambetta', $result->getStreetName()); $this->assertEquals(75020, $result->getPostalCode()); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Paris', $result->getCounty()->getName()); - $this->assertEquals('IdF', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Paris', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('IdF', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('France', $result->getCountry()->getName()); $this->assertNull($result->getCountry()->getCode()); diff --git a/tests/Geocoder/Tests/Provider/FreeGeoIpTest.php b/tests/Geocoder/Tests/Provider/FreeGeoIpTest.php index 655e3568a..2887b49ae 100644 --- a/tests/Geocoder/Tests/Provider/FreeGeoIpTest.php +++ b/tests/Geocoder/Tests/Provider/FreeGeoIpTest.php @@ -55,8 +55,6 @@ public function testGeocodeWithLocalhostIPv4() $result = $results->first(); $this->assertInstanceOf('\Geocoder\Model\Address', $result); $this->assertEquals('localhost', $result->getLocality()); - $this->assertEquals('localhost', $result->getCounty()->getName()); - $this->assertEquals('localhost', $result->getRegion()->getName()); $this->assertEquals('localhost', $result->getCountry()->getName()); } @@ -72,8 +70,6 @@ public function testGeocodeWithLocalhostIPv6() $result = $results->first(); $this->assertInstanceOf('\Geocoder\Model\Address', $result); $this->assertEquals('localhost', $result->getLocality()); - $this->assertEquals('localhost', $result->getCounty()->getName()); - $this->assertEquals('localhost', $result->getRegion()->getName()); $this->assertEquals('localhost', $result->getCountry()->getName()); } @@ -112,7 +108,8 @@ public function testGeocodeWithRealIPv4() $this->assertEquals(-96.8134, $result->getLongitude(), '', 0.01); $this->assertEquals(75093, $result->getPostalCode()); $this->assertEquals('Plano', $result->getLocality()); - $this->assertEquals('Texas', $result->getRegion()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Texas', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); } @@ -132,7 +129,8 @@ public function testGeocodeWithRealIPv6() $this->assertEquals(-96.8134, $result->getLongitude(), '', 0.01); $this->assertEquals(75093, $result->getPostalCode()); $this->assertEquals('Plano', $result->getLocality()); - $this->assertEquals('Texas', $result->getRegion()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Texas', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); } @@ -155,7 +153,8 @@ public function testGeocodeWithUSIPv4() $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); $this->assertCount(1, $results); - $this->assertEquals('48', $results->first()->getRegion()->getCode()); + $this->assertCount(1, $results->first()->getAdminLevels()); + $this->assertEquals('48', $results->first()->getAdminLevels()->get(1)->getCode()); } public function testGeocodeWithUSIPv6() @@ -166,7 +165,8 @@ public function testGeocodeWithUSIPv6() $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); $this->assertCount(1, $results); - $this->assertEquals('48', $results->first()->getRegion()->getCode()); + $this->assertCount(1, $results->first()->getAdminLevels()); + $this->assertEquals('48', $results->first()->getAdminLevels()->get(1)->getCode()); } public function testGeocodeWithUKIPv4() @@ -177,7 +177,8 @@ public function testGeocodeWithUKIPv4() $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); $this->assertCount(1, $results); - $this->assertEquals('H9', $results->first()->getRegion()->getCode()); + $this->assertCount(1, $results->first()->getAdminLevels()); + $this->assertEquals('H9', $results->first()->getAdminLevels()->get(1)->getCode()); } public function testGeocodeWithUKIPv6() @@ -188,7 +189,8 @@ public function testGeocodeWithUKIPv6() $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); $this->assertCount(1, $results); - $this->assertEquals('H9', $results->first()->getRegion()->getCode()); + $this->assertCount(1, $results->first()->getAdminLevels()); + $this->assertEquals('H9', $results->first()->getAdminLevels()->get(1)->getCode()); } /** diff --git a/tests/Geocoder/Tests/Provider/GeoIP2Test.php b/tests/Geocoder/Tests/Provider/GeoIP2Test.php index 7778759b6..f15a7358a 100644 --- a/tests/Geocoder/Tests/Provider/GeoIP2Test.php +++ b/tests/Geocoder/Tests/Provider/GeoIP2Test.php @@ -54,8 +54,6 @@ public function testGeocodeWithLocalhostIPv4() $result = $results->first(); $this->assertInstanceOf('\Geocoder\Model\Address', $result); $this->assertEquals('localhost', $result->getLocality()); - $this->assertEquals('localhost', $result->getCounty()->getName()); - $this->assertEquals('localhost', $result->getRegion()->getName()); $this->assertEquals('localhost', $result->getCountry()->getName()); } @@ -76,7 +74,7 @@ public function testOnlyIpAddressesCouldBeResolved() public static function provideDataForRetrievingGeodata() { $testdata = array( - 'Response with all possible data' => array( + 'Response with data' => array( '74.200.247.59', '{"city":{"geoname_id":2911298,"names":{"de":"Hamburg","en":"Hamburg","es":"Hamburgo","fr":"Hambourg","ja":"\u30cf\u30f3\u30d6\u30eb\u30af","pt-BR":"Hamburgo","ru":"\u0413\u0430\u043c\u0431\u0443\u0440\u0433","zh-CN":"\u6c49\u5821\u5e02"}},"continent":{"code":"EU","geoname_id":6255148,"names":{"de":"Europa","en":"Europe","es":"Europa","fr":"Europe","ja":"\u30e8\u30fc\u30ed\u30c3\u30d1","pt-BR":"Europa","ru":"\u0415\u0432\u0440\u043e\u043f\u0430","zh-CN":"\u6b27\u6d32"}},"country":{"geoname_id":2921044,"iso_code":"DE","names":{"de":"Deutschland","en":"Germany","es":"Alemania","fr":"Allemagne","ja":"\u30c9\u30a4\u30c4\u9023\u90a6\u5171\u548c\u56fd","pt-BR":"Alemanha","ru":"\u0413\u0435\u0440\u043c\u0430\u043d\u0438\u044f","zh-CN":"\u5fb7\u56fd"}},"location":{"latitude":53.55,"longitude":10,"time_zone":"Europe\/Berlin"},"registered_country":{"geoname_id":2921044,"iso_code":"DE","names":{"de":"Deutschland","en":"Germany","es":"Alemania","fr":"Allemagne","ja":"\u30c9\u30a4\u30c4\u9023\u90a6\u5171\u548c\u56fd","pt-BR":"Alemanha","ru":"\u0413\u0435\u0440\u043c\u0430\u043d\u0438\u044f","zh-CN":"\u5fb7\u56fd"}},"subdivisions":[{"geoname_id":2911297,"iso_code":"HH","names":{"de":"Hamburg","en":"Hamburg","es":"Hamburgo","fr":"Hambourg"}}],"traits":{"ip_address":"74.200.247.59"}}', array( @@ -88,15 +86,42 @@ public static function provideDataForRetrievingGeodata() 'locality' => 'Hamburg', 'subLocality' => null, 'postalCode' => null, - 'county' => null, - 'countyCode' => null, - 'region' => 'Hamburg', - 'regionCode' => 'HH', + 'adminLevels' => [1 => [ + 'name' => 'Hamburg', + 'code' => 'HH', + ]], 'country' => 'Germany', 'countryCode' => 'DE', 'timezone' => 'Europe/Berlin', ) ), + 'Response with all possible data' => array( + '93.36.20.217', + '{"country": {"iso_code": "IT","names": {"pt-BR": "Itália","es": "Italia","ru": "Италия","en": "Italy","zh-CN": "意大利","fr": "Italie","de": "Italien","ja": "イタリア共和国"},"geoname_id": 3175395},"location": {"longitude": 9.2667,"latitude": 45.5833,"time_zone": "Europe/Rome"},"subdivisions": [{"iso_code": "25","names": {"en": "Lombardy","fr": "Lombardie","de": "Lombardei","es": "Lombardía"},"geoname_id": 3174618},{"iso_code": "MB","names": {"en": "Monza Brianza"},"geoname_id": 6955700}],"postal": {"code": "20900"},"city": {"names": {"pt-BR": "Monza","es": "Monza","ru": "Монца","en": "Monza","zh-CN": "蒙扎","fr": "Monza","de": "Monza","ja": "モンツァ"},"geoname_id": 3172629},"continent": {"names": {"pt-BR": "Europa","es": "Europa","ru": "Европа","en": "Europe","zh-CN": "欧洲","fr": "Europe","de": "Europa","ja": "ヨーロッパ"},"geoname_id": 6255148,"code": "EU"},"registered_country": {"iso_code": "IT","names": {"pt-BR": "Itália","es": "Italia","ru": "Италия","en": "Italy","zh-CN": "意大利","fr": "Italie","de": "Italien","ja": "イタリア共和国"},"geoname_id": 3175395},"traits": {"domain": "fastwebnet.it","autonomous_system_number": 12874,"ip_address": "93.36.20.217","organization": "Fastweb","isp": "Fastweb","autonomous_system_organization": "Fastweb SpA"},"represented_country": {"names": {}}}', + array( + 'latitude' => 45.5833, + 'longitude' => 9.2667, + 'boundsDefined' => null, + 'streetNumber' => null, + 'streetName' => null, + 'locality' => 'Monza', + 'subLocality' => null, + 'postalCode' => null, + 'adminLevels' => [ + 1 => [ + 'name' => 'Lombardy', + 'code' => '25', + ], + 2 => [ + 'name' => 'Monza Brianza', + 'code' => 'MB', + ], + ], + 'country' => 'Italy', + 'countryCode' => 'IT', + 'timezone' => 'Europe/Rome', + ) + ), 'Response with all data null' => array( '74.200.247.59', '{}', @@ -109,10 +134,7 @@ public static function provideDataForRetrievingGeodata() 'locality' => null, 'subLocality' => null, 'postalCode' => null, - 'county' => null, - 'countyCode' => null, - 'region' => null, - 'regionCode' => null, + 'adminLevels' => [], 'country' => null, 'countryCode' => null, 'timezone' => null, @@ -151,13 +173,13 @@ public function testRetrievingGeodata($address, $adapterResponse, $expectedGeoda $this->assertEquals($expectedGeodata['locality'], $result->getLocality()); $this->assertEquals($expectedGeodata['subLocality'], $result->getSubLocality()); $this->assertEquals($expectedGeodata['postalCode'], $result->getPostalCode()); - $this->assertEquals($expectedGeodata['county'], $result->getCounty()->getName()); - $this->assertEquals($expectedGeodata['countyCode'], $result->getCounty()->getCode()); - $this->assertEquals($expectedGeodata['region'], $result->getRegion()->getName()); - $this->assertEquals($expectedGeodata['regionCode'], $result->getRegion()->getCode()); $this->assertEquals($expectedGeodata['country'], $result->getCountry()->getName()); $this->assertEquals($expectedGeodata['countryCode'], $result->getCountry()->getCode()); $this->assertEquals($expectedGeodata['timezone'], $result->getTimezone()); + foreach ($expectedGeodata['adminLevels'] as $level => $data) { + $this->assertEquals($data['name'], $result->getAdminLevels()->get($level)->getName()); + $this->assertEquals($data['code'], $result->getAdminLevels()->get($level)->getCode()); + } } /** diff --git a/tests/Geocoder/Tests/Provider/GeoIPsTest.php b/tests/Geocoder/Tests/Provider/GeoIPsTest.php index d5cf60b92..873c0de17 100644 --- a/tests/Geocoder/Tests/Provider/GeoIPsTest.php +++ b/tests/Geocoder/Tests/Provider/GeoIPsTest.php @@ -64,8 +64,6 @@ public function testGeocodeWithLocalhostIPv4() $result = $results->first(); $this->assertInstanceOf('\Geocoder\Model\Address', $result); $this->assertEquals('localhost', $result->getLocality()); - $this->assertEquals('localhost', $result->getCounty()->getName()); - $this->assertEquals('localhost', $result->getRegion()->getName()); $this->assertEquals('localhost', $result->getCountry()->getName()); } @@ -140,7 +138,7 @@ public function testGeocodeWithRealIPv4GetsFakeContentFormattedEmpty() $this->assertNull($result->getLongitude()); $this->assertNull($result->getPostalCode()); $this->assertNull($result->getLocality()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertEmpty($result->getAdminLevels()); $this->assertNull($result->getCountry()->getName()); $this->assertNull($result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); @@ -184,9 +182,10 @@ public function testGeocodeWithRealIPv4GetsFakeContent() $this->assertNull($result->getStreetName()); $this->assertNull($result->getPostalCode()); $this->assertEquals('PROVO', $result->getLocality()); - $this->assertEquals('UTAH', $result->getCounty()->getName()); - $this->assertEquals('UTAH', $result->getRegion()->getName()); - $this->assertEquals('UT',$result->getRegion()->getCode()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('UTAH', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('UTAH', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('UT',$result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('UNITED STATES', $result->getCountry()->getName()); $this->assertEquals('US',$result->getCountry()->getCode()); $this->assertEquals('MST', $result->getTimezone()); @@ -342,9 +341,10 @@ public function testGeocodeWithRealIPv4() $this->assertNull($result->getStreetName()); $this->assertNull($result->getPostalCode()); $this->assertEquals('PROVO', $result->getLocality()); - $this->assertEquals('UTAH', $result->getCounty()->getName()); - $this->assertEquals('UTAH', $result->getRegion()->getName()); - $this->assertEquals('UT',$result->getRegion()->getCode()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('UTAH', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('UTAH', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('UT',$result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('UNITED STATES', $result->getCountry()->getName()); $this->assertEquals('US',$result->getCountry()->getCode()); $this->assertEquals('MST', $result->getTimezone()); diff --git a/tests/Geocoder/Tests/Provider/GeoPluginTest.php b/tests/Geocoder/Tests/Provider/GeoPluginTest.php index 42e79d3b0..5241ddb4b 100644 --- a/tests/Geocoder/Tests/Provider/GeoPluginTest.php +++ b/tests/Geocoder/Tests/Provider/GeoPluginTest.php @@ -53,8 +53,6 @@ public function testGeocodeWithLocalhostIPv4() $result = $results->first(); $this->assertEquals('localhost', $result->getLocality()); - $this->assertEquals('localhost', $result->getCounty()->getName()); - $this->assertEquals('localhost', $result->getRegion()->getName()); $this->assertEquals('localhost', $result->getCountry()->getName()); } @@ -68,8 +66,6 @@ public function testGeocodeWithLocalhostIPv6() $result = $results->first(); $this->assertEquals('localhost', $result->getLocality()); - $this->assertEquals('localhost', $result->getCounty()->getName()); - $this->assertEquals('localhost', $result->getRegion()->getName()); $this->assertEquals('localhost', $result->getCountry()->getName()); } @@ -106,8 +102,9 @@ public function testGeocodeWithRealIPv4() $this->assertEquals(40.711101999999997, $result->getLatitude(), '', 0.0001); $this->assertEquals(-73.946899000000002, $result->getLongitude(), '', 0.0001); $this->assertNull($result->getLocality()); - $this->assertEquals('New York', $result->getRegion()->getName()); - $this->assertEquals('NY', $result->getRegion()->getCode()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('New York', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('NY', $result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); } diff --git a/tests/Geocoder/Tests/Provider/GeoipTest.php b/tests/Geocoder/Tests/Provider/GeoipTest.php index 4314a8cd5..722572f70 100644 --- a/tests/Geocoder/Tests/Provider/GeoipTest.php +++ b/tests/Geocoder/Tests/Provider/GeoipTest.php @@ -67,9 +67,8 @@ public function testGeocodeWithLocalhostIPv4() $this->assertNull($result->getLongitude()); $this->assertNull($result->getPostalCode()); $this->assertNull($result->getTimezone()); + $this->assertEmpty($result->getAdminLevels()); $this->assertEquals('localhost', $result->getLocality()); - $this->assertNotNull($result->getCounty()); - $this->assertNotNull($result->getRegion()); $this->assertNotNull($result->getCountry()); } diff --git a/tests/Geocoder/Tests/Provider/GeonamesTest.php b/tests/Geocoder/Tests/Provider/GeonamesTest.php index 988d5f065..fbde84629 100644 --- a/tests/Geocoder/Tests/Provider/GeonamesTest.php +++ b/tests/Geocoder/Tests/Provider/GeonamesTest.php @@ -102,8 +102,9 @@ public function testGeocodeWithRealPlace() $this->assertEquals(51.865368153381, $result->getBounds()->getNorth(), '', 0.01); $this->assertEquals(0.45212493672386, $result->getBounds()->getEast(), '', 0.01); $this->assertEquals('London', $result->getLocality()); - $this->assertEquals('Greater London', $result->getCounty()->getName()); - $this->assertEquals('England', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Greater London', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('England', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('United Kingdom', $result->getCountry()->getName()); $this->assertEquals('GB', $result->getCountryCode()); $this->assertEquals('Europe/London', $result->getTimezone()); @@ -119,8 +120,10 @@ public function testGeocodeWithRealPlace() $this->assertEquals(-32.925573728925, $result->getBounds()->getNorth(), '', 0.01); $this->assertEquals(28.018503381239, $result->getBounds()->getEast(), '', 0.01); $this->assertEquals('East London', $result->getLocality()); - $this->assertEquals('Buffalo City Metropolitan Municipality', $result->getCounty()->getName()); - $this->assertEquals('Eastern Cape', $result->getRegion()->getName()); + $this->assertCount(3, $result->getAdminLevels()); + $this->assertEquals('Buffalo City', $result->getAdminLevels()->get(3)->getName()); + $this->assertEquals('Buffalo City Metropolitan Municipality', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Eastern Cape', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('South Africa', $result->getCountry()->getName()); $this->assertEquals('ZA', $result->getCountryCode()); $this->assertEquals('Africa/Johannesburg', $result->getTimezone()); @@ -136,8 +139,10 @@ public function testGeocodeWithRealPlace() $this->assertEquals(51.869628267826, $result->getBounds()->getNorth(), '', 0.01); $this->assertEquals(0.48608279418978, $result->getBounds()->getEast(), '', 0.01); $this->assertEquals('City of London', $result->getLocality()); - $this->assertEquals('Greater London', $result->getCounty()->getName()); - $this->assertEquals('England', $result->getRegion()->getName()); + $this->assertCount(3, $result->getAdminLevels()); + $this->assertEquals('City of London', $result->getAdminLevels()->get(3)->getName()); + $this->assertEquals('Greater London', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('England', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('United Kingdom', $result->getCountry()->getName()); $this->assertEquals('GB', $result->getCountryCode()); $this->assertEquals('Europe/London', $result->getTimezone()); @@ -153,8 +158,8 @@ public function testGeocodeWithRealPlace() $this->assertEquals(43.059702923237, $result->getBounds()->getNorth(), '', 0.01); $this->assertEquals(-81.128595097537, $result->getBounds()->getEast(), '', 0.01); $this->assertEquals('London', $result->getLocality()); - $this->assertEquals('', $result->getCounty()->getName()); - $this->assertEquals('Ontario', $result->getRegion()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Ontario', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Canada', $result->getCountry()->getName()); $this->assertEquals('CA', $result->getCountryCode()); $this->assertEquals('America/Toronto', $result->getTimezone()); @@ -170,8 +175,9 @@ public function testGeocodeWithRealPlace() $this->assertEquals(41.377219912096, $result->getBounds()->getNorth(), '', 0.01); $this->assertEquals(-72.070780545154, $result->getBounds()->getEast(), '', 0.01); $this->assertEquals('New London', $result->getLocality()); - $this->assertEquals('New London County', $result->getCounty()->getName()); - $this->assertEquals('Connecticut', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('New London County', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Connecticut', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountryCode()); $this->assertEquals('America/New_York', $result->getTimezone()); @@ -200,8 +206,9 @@ public function testGeocodeWithRealPlaceWithLocale() $this->assertEquals(51.86537, $result->getBounds()->getNorth(), '', 0.01); $this->assertEquals(0.45212, $result->getBounds()->getEast(), '', 0.01); $this->assertEquals('Londra', $result->getLocality()); - $this->assertEquals('Greater London', $result->getCounty()->getName()); - $this->assertEquals('Inghilterra', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Greater London', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Inghilterra', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Regno Unito', $result->getCountry()->getName()); $this->assertEquals('GB', $result->getCountryCode()); $this->assertEquals('Europe/London', $result->getTimezone()); @@ -217,8 +224,10 @@ public function testGeocodeWithRealPlaceWithLocale() $this->assertEquals(-32.925573728925, $result->getBounds()->getNorth(), '', 0.01); $this->assertEquals(28.018503381239, $result->getBounds()->getEast(), '', 0.01); $this->assertEquals('East London', $result->getLocality()); - $this->assertEquals('Buffalo City Metropolitan Municipality', $result->getCounty()->getName()); - $this->assertEquals('Eastern Cape', $result->getRegion()->getName()); + $this->assertCount(3, $result->getAdminLevels()); + $this->assertEquals('Buffalo City', $result->getAdminLevels()->get(3)->getName()); + $this->assertEquals('Buffalo City Metropolitan Municipality', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Eastern Cape', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Sudafrica', $result->getCountry()->getName()); $this->assertEquals('ZA', $result->getCountryCode()); $this->assertEquals('Africa/Johannesburg', $result->getTimezone()); @@ -234,8 +243,10 @@ public function testGeocodeWithRealPlaceWithLocale() $this->assertEquals(51.869628267826, $result->getBounds()->getNorth(), '', 0.01); $this->assertEquals(0.48608279418978, $result->getBounds()->getEast(), '', 0.01); $this->assertEquals('Città di Londra', $result->getLocality()); - $this->assertEquals('Greater London', $result->getCounty()->getName()); - $this->assertEquals('Inghilterra', $result->getRegion()->getName()); + $this->assertCount(3, $result->getAdminLevels()); + $this->assertEquals('City of London', $result->getAdminLevels()->get(3)->getName()); + $this->assertEquals('Greater London', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Inghilterra', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Regno Unito', $result->getCountry()->getName()); $this->assertEquals('GB', $result->getCountryCode()); $this->assertEquals('Europe/London', $result->getTimezone()); @@ -251,8 +262,8 @@ public function testGeocodeWithRealPlaceWithLocale() $this->assertEquals(43.059702923237, $result->getBounds()->getNorth(), '', 0.01); $this->assertEquals(-81.128595097537, $result->getBounds()->getEast(), '', 0.01); $this->assertEquals('London', $result->getLocality()); - $this->assertEquals('', $result->getCounty()->getName()); - $this->assertEquals('Ontario', $result->getRegion()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Ontario', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Canada', $result->getCountry()->getName()); $this->assertEquals('CA', $result->getCountryCode()); $this->assertEquals('America/Toronto', $result->getTimezone()); @@ -268,8 +279,9 @@ public function testGeocodeWithRealPlaceWithLocale() $this->assertEquals(41.377219912096, $result->getBounds()->getNorth(), '', 0.01); $this->assertEquals(-72.070780545154, $result->getBounds()->getEast(), '', 0.01); $this->assertEquals('New London', $result->getLocality()); - $this->assertEquals('Contea di New London', $result->getCounty()->getName()); - $this->assertEquals('Connecticut', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Contea di New London', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Connecticut', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Stati Uniti', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountryCode()); $this->assertEquals('America/New_York', $result->getTimezone()); @@ -293,8 +305,9 @@ public function testReverseWithRealCoordinates() $this->assertEquals(51.50853, $result->getLatitude(), '', 0.01); $this->assertEquals(-0.12574, $result->getLongitude(), '', 0.01); $this->assertEquals('London', $result->getLocality()); - $this->assertEquals('Greater London', $result->getCounty()->getName()); - $this->assertEquals('England', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Greater London', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('England', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('United Kingdom', $result->getCountry()->getName()); $this->assertEquals('GB', $result->getCountryCode()); $this->assertEquals('Europe/London', $result->getTimezone()); @@ -318,8 +331,9 @@ public function testReverseWithRealCoordinatesWithLocale() $this->assertEquals(51.50853, $result->getLatitude(), '', 0.01); $this->assertEquals(-0.12574, $result->getLongitude(), '', 0.01); $this->assertEquals('Londra', $result->getLocality()); - $this->assertEquals('Greater London', $result->getCounty()->getName()); - $this->assertEquals('Inghilterra', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Greater London', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Inghilterra', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Regno Unito', $result->getCountry()->getName()); $this->assertEquals('GB', $result->getCountryCode()); $this->assertEquals('Europe/London', $result->getTimezone()); diff --git a/tests/Geocoder/Tests/Provider/GoogleMapsTest.php b/tests/Geocoder/Tests/Provider/GoogleMapsTest.php index cedc81f05..ce33c8b3a 100644 --- a/tests/Geocoder/Tests/Provider/GoogleMapsTest.php +++ b/tests/Geocoder/Tests/Provider/GoogleMapsTest.php @@ -130,8 +130,8 @@ public function testGeocodeWithRealAddress() $this->assertEquals('Avenue Gambetta', $result->getStreetName()); $this->assertEquals(75020, $result->getPostalCode()); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Paris', $result->getCounty()->getName()); - $this->assertEquals('Île-de-France', $result->getRegion()->getName()); + $this->assertEquals('Paris', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Île-de-France', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('France', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); @@ -161,8 +161,9 @@ public function testGeocodeWithRealAddressWithSsl() $this->assertEquals('Avenue Gambetta', $result->getStreetName()); $this->assertEquals(75020, $result->getPostalCode()); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Paris', $result->getCounty()->getName()); - $this->assertEquals('Île-de-France', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Paris', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Île-de-France', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('France', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); @@ -267,8 +268,9 @@ public function testReverseWithRealCoordinates() $this->assertEquals('Avenue Gambetta', $result->getStreetName()); $this->assertEquals(75020, $result->getPostalCode()); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Paris', $result->getCounty()->getName()); - $this->assertEquals('Île-de-France', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Paris', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Île-de-France', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('France', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); } @@ -328,7 +330,8 @@ public function testGeocodeWithRealValidApiKey() $this->assertTrue($result->getBounds()->isDefined()); $this->assertEquals('New York', $result->getLocality()); $this->assertEquals('Manhattan', $result->getSubLocality()); - $this->assertEquals('New York', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('New York', $result->getAdminLevels()->get(1)->getName()); } /** diff --git a/tests/Geocoder/Tests/Provider/HostIpTest.php b/tests/Geocoder/Tests/Provider/HostIpTest.php index 127c9eb25..51bec9d7e 100644 --- a/tests/Geocoder/Tests/Provider/HostIpTest.php +++ b/tests/Geocoder/Tests/Provider/HostIpTest.php @@ -58,10 +58,9 @@ public function testGeocodeWithLocalhostIPv4() $this->assertNull($result->getLongitude()); $this->assertNull($result->getPostalCode()); $this->assertNull($result->getTimezone()); + $this->assertEmpty($result->getAdminLevels()); $this->assertEquals('localhost', $result->getLocality()); - $this->assertEquals('localhost', $result->getCounty()->getName()); - $this->assertEquals('localhost', $result->getRegion()->getName()); $this->assertEquals('localhost', $result->getCountry()->getName()); } @@ -110,7 +109,7 @@ public function testGeocodeWithRealIPv4() $this->assertEquals(2.6167, $result->getLongitude(), '', 0.0001); $this->assertNull($result->getPostalCode()); $this->assertEquals('Aulnat', $result->getLocality()); - $this->assertNull($result->getRegion()->getName()); + $this->assertEmpty($result->getAdminLevels()); $this->assertEquals('FRANCE', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); } diff --git a/tests/Geocoder/Tests/Provider/IpInfoDbTest.php b/tests/Geocoder/Tests/Provider/IpInfoDbTest.php index 344bab18b..3aa58c38f 100644 --- a/tests/Geocoder/Tests/Provider/IpInfoDbTest.php +++ b/tests/Geocoder/Tests/Provider/IpInfoDbTest.php @@ -86,10 +86,9 @@ public function testGeocodeWithLocalhostIPv4() $this->assertNull($result->getLongitude()); $this->assertNull($result->getPostalCode()); $this->assertNull($result->getTimezone()); + $this->assertEmpty($result->getAdminLevels()); $this->assertEquals('localhost', $result->getLocality()); - $this->assertEquals('localhost', $result->getCounty()->getName()); - $this->assertEquals('localhost', $result->getRegion()->getName()); $this->assertEquals('localhost', $result->getCountry()->getName()); } @@ -141,9 +140,10 @@ public function testGeocodeWithRealIPv4() $this->assertEquals(37.406, $result->getLatitude(), '', 0.001); $this->assertEquals(-122.079, $result->getLongitude(), '', 0.001); $this->assertEquals(94043, $result->getPostalCode()); - $this->assertEquals('MOUNTAIN VIEW', $result->getLocality()); - $this->assertEquals('CALIFORNIA', $result->getRegion()->getName()); - $this->assertEquals('UNITED STATES', $result->getCountry()->getName()); + $this->assertEquals('Mountain View', $result->getLocality()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('California', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); $this->assertEquals('America/Los_Angeles', $result->getTimezone()); } @@ -184,8 +184,8 @@ public function testGetGeocodedDataWithCountryPrecision() $this->assertNull($result->getLongitude()); $this->assertNull($result->getPostalCode()); $this->assertNull($result->getLocality()); - $this->assertNull($result->getRegion()->getName()); - $this->assertEquals('UNITED STATES', $result->getCountry()->getName()); + $this->assertEmpty($result->getAdminLevels()); + $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); } diff --git a/tests/Geocoder/Tests/Provider/MapQuestTest.php b/tests/Geocoder/Tests/Provider/MapQuestTest.php index d87686f68..355440e04 100644 --- a/tests/Geocoder/Tests/Provider/MapQuestTest.php +++ b/tests/Geocoder/Tests/Provider/MapQuestTest.php @@ -68,13 +68,14 @@ public function testGeocodeWithRealAddress() $this->assertEquals('10 Avenue Gambetta', $result->getStreetName()); $this->assertEquals(75020, $result->getPostalCode()); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Paris', $result->getCounty()->getName()); - $this->assertEquals('Ile-de-France', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Paris', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Ile-de-France', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('FR', $result->getCountry()->getName()); $this->assertFalse($result->getBounds()->isDefined()); $this->assertNull($result->getStreetNumber()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); } @@ -112,13 +113,14 @@ public function testReverseWithRealCoordinates() $this->assertEquals('Lancaster Gate', $result->getStreetName()); $this->assertEquals('LA1 1LZ', $result->getPostalCode()); $this->assertEquals('Lancaster', $result->getLocality()); - $this->assertEquals('Lancashire', $result->getCounty()->getName()); - $this->assertEquals('England', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Lancashire', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('England', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('GB', $result->getCountry()->getName()); $this->assertFalse($result->getBounds()->isDefined()); $this->assertNull($result->getStreetNumber()); - $this->assertNull($result->getRegion()->getcode()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); } @@ -141,8 +143,9 @@ public function testGeocodeWithCity() $this->assertEquals(52.374478, $result->getLatitude(), '', 0.01); $this->assertEquals(9.738553, $result->getLongitude(), '', 0.01); $this->assertEquals('Hanover', $result->getLocality()); - $this->assertEquals('Region Hannover', $result->getCounty()->getName()); - $this->assertEquals('Lower Saxony', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Region Hannover', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Lower Saxony', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('DE', $result->getCountry()->getName()); /** @var \Geocoder\Model\Address $result */ @@ -151,8 +154,9 @@ public function testGeocodeWithCity() $this->assertEquals(52.374478000000003, $result->getLatitude(), '', 0.01); $this->assertEquals(9.7385529999999996, $result->getLongitude(), '', 0.01); $this->assertEquals('Hanover', $result->getLocality()); - $this->assertEquals('Region Hannover', $result->getCounty()->getName()); - $this->assertEquals('Lower Saxony', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Region Hannover', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Lower Saxony', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('DE', $result->getCountry()->getName()); /** @var \Geocoder\Model\Address $result */ @@ -161,8 +165,9 @@ public function testGeocodeWithCity() $this->assertEquals(52.374478000000003, $result->getLatitude(), '', 0.01); $this->assertEquals(9.7385529999999996, $result->getLongitude(), '', 0.01); $this->assertEquals('Hanover', $result->getLocality()); - $this->assertEquals('Region Hannover', $result->getCounty()->getName()); - $this->assertEquals('Lower Saxony', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Region Hannover', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Lower Saxony', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('DE', $result->getCountry()->getName()); /** @var \Geocoder\Model\Address $result */ @@ -171,8 +176,9 @@ public function testGeocodeWithCity() $this->assertEquals(52.374478000000003, $result->getLatitude(), '', 0.01); $this->assertEquals(9.7385529999999996, $result->getLongitude(), '', 0.01); $this->assertEquals('Hanover', $result->getLocality()); - $this->assertEquals('Region Hannover', $result->getCounty()->getName()); - $this->assertEquals('Lower Saxony', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Region Hannover', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Lower Saxony', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('DE', $result->getCountry()->getName()); } @@ -196,13 +202,13 @@ public function testGeocodeWithCityDistrict() $this->assertEquals('Kalbacher Hauptstraße 10', $result->getStreetName()); $this->assertEquals(60437, $result->getPostalCode()); $this->assertEquals('Frankfurt', $result->getLocality()); - $this->assertNull($result->getCounty()->getName()); - $this->assertEquals('Hesse', $result->getRegion()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Hesse', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('DE', $result->getCountry()->getName()); $this->assertFalse($result->getBounds()->isDefined()); $this->assertNull($result->getStreetNumber()); - $this->assertNull($result->getRegion()->getcode()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); } diff --git a/tests/Geocoder/Tests/Provider/MaxMindBinaryTest.php b/tests/Geocoder/Tests/Provider/MaxMindBinaryTest.php index 48c6a2dbd..33ab95b65 100644 --- a/tests/Geocoder/Tests/Provider/MaxMindBinaryTest.php +++ b/tests/Geocoder/Tests/Provider/MaxMindBinaryTest.php @@ -61,10 +61,9 @@ public function testLocationResultContainsExpectedFieldsForAnAmericanIp() $this->assertNull($result->getPostalCode()); $this->assertEquals('East Syracuse', $result->getLocality()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getCounty()->getName()); - $this->assertNull($result->getCounty()->getCode()); - $this->assertEquals('NY', $result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('NY', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); @@ -90,10 +89,9 @@ public function testLocationResultContainsExpectedFieldsForASpanishIp() $this->assertNull($result->getPostalCode()); $this->assertEquals('Sabadell', $result->getLocality()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getCounty()->getName()); - $this->assertNull($result->getCounty()->getCode()); - $this->assertEquals('56', $result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('56', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('Spain', $result->getCountry()->getName()); $this->assertEquals('ES', $result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); diff --git a/tests/Geocoder/Tests/Provider/MaxMindTest.php b/tests/Geocoder/Tests/Provider/MaxMindTest.php index 35ca2ab56..876f09a9d 100644 --- a/tests/Geocoder/Tests/Provider/MaxMindTest.php +++ b/tests/Geocoder/Tests/Provider/MaxMindTest.php @@ -64,8 +64,6 @@ public function testGeocodeWithLocalhostIPv4() $result = $results->first(); $this->assertInstanceOf('\Geocoder\Model\Address', $result); $this->assertEquals('localhost', $result->getLocality()); - $this->assertEquals('localhost', $result->getCounty()->getName()); - $this->assertEquals('localhost', $result->getRegion()->getName()); $this->assertEquals('localhost', $result->getCountry()->getName()); } @@ -81,8 +79,6 @@ public function testGeocodeWithLocalhostIPv6() $result = $results->first(); $this->assertInstanceOf('\Geocoder\Model\Address', $result); $this->assertEquals('localhost', $result->getLocality()); - $this->assertEquals('localhost', $result->getCounty()->getName()); - $this->assertEquals('localhost', $result->getRegion()->getName()); $this->assertEquals('localhost', $result->getCountry()->getName()); } @@ -144,10 +140,7 @@ public function testGeocodeWithRealIPv4GetsFakeContentFormattedEmpty() $this->assertNull($result->getPostalCode()); $this->assertNull($result->getLocality()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getCounty()->getName()); - $this->assertNull($result->getCounty()->getCode()); - $this->assertNull($result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertEmpty($result->getAdminLevels()); $this->assertNull($result->getCountry()->getName()); $this->assertNull($result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); @@ -172,10 +165,9 @@ public function testGeocodeWithRealIPv4GetsFakeContent() $this->assertEquals(75093, $result->getPostalCode()); $this->assertEquals('Plano', $result->getLocality()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getCounty()->getName()); - $this->assertNull($result->getCounty()->getCode()); - $this->assertNull($result->getRegion()->getName()); - $this->assertEquals('TX', $result->getRegion()->getCode()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertNull($result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('TX', $result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); @@ -205,10 +197,9 @@ public function testGeocodeWithRealIPv4GetsFakeContent() $this->assertEquals(94110, $result->getPostalCode()); $this->assertEquals('San Francisco', $result->getLocality()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getCounty()->getName()); - $this->assertNull($result->getCounty()->getCode()); - $this->assertNull($result->getRegion()->getName()); - $this->assertEquals('CA', $result->getRegion()->getCode()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertNull($result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('CA', $result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); @@ -320,10 +311,9 @@ public function testGeocodeServiceWithRealIPv4() $this->assertEquals(75093, $result->getPostalCode()); $this->assertEquals('Plano', $result->getLocality()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getCounty()->getName()); - $this->assertNull($result->getCounty()->getCode()); - $this->assertNull($result->getRegion()->getName()); - $this->assertEquals('TX', $result->getRegion()->getCode()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertNull($result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('TX', $result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); @@ -353,10 +343,9 @@ public function testGeocodeOmniServiceWithRealIPv4() $this->assertEquals(75093, $result->getPostalCode()); $this->assertEquals('Plano', $result->getLocality()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getCounty()->getName()); - $this->assertNull($result->getCounty()->getCode()); - $this->assertEquals('Texas', $result->getRegion()->getName()); - $this->assertEquals('TX', $result->getRegion()->getCode()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Texas', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('TX', $result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); $this->assertEquals('America/Chicago', $result->getTimezone()); @@ -386,10 +375,9 @@ public function testGeocodeOmniServiceWithRealIPv4WithSslAndEncoding() $this->assertNull($result->getPostalCode()); $this->assertEquals('Florianópolis', $result->getLocality()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getCounty()->getName()); - $this->assertNull($result->getCounty()->getCode()); - $this->assertEquals('Santa Catarina', $result->getRegion()->getName()); - $this->assertEquals('26', $result->getRegion()->getCode()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Santa Catarina', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('26', $result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('Brazil', $result->getCountry()->getName()); $this->assertEquals('BR', $result->getCountry()->getCode()); $this->assertEquals('America/Sao_Paulo', $result->getTimezone()); @@ -418,10 +406,9 @@ public function testGeocodeWithRealIPv6() $this->assertEquals(84606, $result->getPostalCode()); $this->assertEquals('Provo', $result->getLocality()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getCounty()->getName()); - $this->assertNull($result->getCounty()->getCode()); - $this->assertNull($result->getRegion()->getName()); - $this->assertEquals('UT', $result->getRegion()->getCode()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertNull($result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('UT', $result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); @@ -451,10 +438,9 @@ public function testGeocodeOmniServiceWithRealIPv6WithSsl() $this->assertEquals(84606, $result->getPostalCode()); $this->assertEquals('Provo', $result->getLocality()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getCounty()->getName()); - $this->assertNull($result->getCounty()->getCode()); - $this->assertEquals('Utah', $result->getRegion()->getName()); - $this->assertEquals('UT', $result->getRegion()->getCode()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Utah', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('UT', $result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); $this->assertEquals('America/Denver', $result->getTimezone()); diff --git a/tests/Geocoder/Tests/Provider/OpenCageTest.php b/tests/Geocoder/Tests/Provider/OpenCageTest.php index ebbf76dff..050bd72f6 100644 --- a/tests/Geocoder/Tests/Provider/OpenCageTest.php +++ b/tests/Geocoder/Tests/Provider/OpenCageTest.php @@ -72,8 +72,9 @@ public function testGeocodeWithRealAddress() $this->assertEquals('Avenue Gambetta', $result->getStreetName()); $this->assertEquals(75020, $result->getPostalCode()); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Paris', $result->getCounty()->getName()); - $this->assertEquals('Ile-de-France', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Paris', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Ile-de-France', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('France', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); $this->assertEquals('Europe/Paris', $result->getTimezone()); @@ -118,8 +119,9 @@ public function testReverseWithRealCoordinates() $this->assertNull($result->getStreetName()); $this->assertNull($result->getPostalCode()); $this->assertEquals('Lancaster', $result->getLocality()); - $this->assertEquals('Lancashire', $result->getCounty()->getName()); - $this->assertEquals('England', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Lancashire', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('England', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('United Kingdom', $result->getCountry()->getName()); $this->assertEquals('GB', $result->getCountry()->getCode()); $this->assertEquals('Europe/London' , $result->getTimezone()); @@ -143,8 +145,9 @@ public function testGeocodeWithCity() $this->assertEquals(52.374478, $result->getLatitude(), '', 0.01); $this->assertEquals(9.738553, $result->getLongitude(), '', 0.01); $this->assertEquals('Hanover', $result->getLocality()); - $this->assertEquals('Region Hannover', $result->getCounty()->getName()); - $this->assertEquals('Lower Saxony', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Region Hannover', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Lower Saxony', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Germany', $result->getCountry()->getName()); /** @var \Geocoder\Model\Address $result */ @@ -153,7 +156,8 @@ public function testGeocodeWithCity() $this->assertEquals(37.744783, $result->getLatitude(), '', 0.01); $this->assertEquals(-77.4464165, $result->getLongitude(), '', 0.01); $this->assertNull($result->getLocality()); - $this->assertEquals('Hanover', $result->getCounty()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Hanover', $result->getAdminLevels()->get(2)->getName()); $this->assertEquals('United States of America', $result->getCountry()->getName()); /** @var \Geocoder\Model\Address $result */ @@ -162,7 +166,8 @@ public function testGeocodeWithCity() $this->assertEquals(18.3840489, $result->getLatitude(), '', 0.01); $this->assertEquals(-78.131485, $result->getLongitude(), '', 0.01); $this->assertNull($result->getLocality()); - $this->assertEquals('Hanover', $result->getCounty()->getName()); + $this->assertTrue( $result->getAdminLevels()->has(2)); + $this->assertEquals('Hanover', $result->getAdminLevels()->get(2)->getName()); $this->assertEquals('Jamaica', $result->getCountry()->getName()); /** @var \Geocoder\Model\Address $result */ @@ -171,8 +176,9 @@ public function testGeocodeWithCity() $this->assertEquals(43.7033073, $result->getLatitude(), '', 0.01); $this->assertEquals(-72.2885663, $result->getLongitude(), '', 0.01); $this->assertEquals('Hanover', $result->getLocality()); - $this->assertEquals('Grafton County', $result->getCounty()->getName()); - $this->assertEquals('New Hampshire', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Grafton County', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('New Hampshire', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('United States of America', $result->getCountry()->getName()); } @@ -197,9 +203,10 @@ public function testGeocodeWithCityDistrict() $this->assertEquals('Kalbacher Hauptstraße', $result->getStreetName()); $this->assertEquals(60437, $result->getPostalCode()); $this->assertEquals('Frankfurt', $result->getLocality()); - $this->assertEquals('Frankfurt', $result->getCounty()->getName()); - $this->assertEquals('Hesse', $result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Frankfurt', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Hesse', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('Germany', $result->getCountry()->getName()); $this->assertEquals('DE', $result->getCountry()->getCode()); $this->assertEquals('Europe/Berlin', $result->getTimezone()); @@ -221,8 +228,9 @@ public function testGeocodeWithLocale() $result = $results->first(); $this->assertInstanceOf('\Geocoder\Model\Address', $result); $this->assertEquals('Londres', $result->getLocality()); - $this->assertEquals('Londres', $result->getCounty()->getName()); - $this->assertEquals('Inglaterra', $result->getRegion()->getName()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Londres', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Inglaterra', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Reino Unido', $result->getCountry()->getName()); $this->assertEquals('GB', $result->getCountry()->getCode()); } diff --git a/tests/Geocoder/Tests/Provider/OpenStreetMapTest.php b/tests/Geocoder/Tests/Provider/OpenStreetMapTest.php index 7aa9a37a1..4f98e1af9 100644 --- a/tests/Geocoder/Tests/Provider/OpenStreetMapTest.php +++ b/tests/Geocoder/Tests/Provider/OpenStreetMapTest.php @@ -36,9 +36,10 @@ public function testGeocodeWithRealAddress() $this->assertEquals(75000, $result->getPostalCode()); $this->assertNull($result->getSubLocality()); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Paris', $result->getCounty()->getName()); - $this->assertEquals('Île-de-France', $result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Paris', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Île-de-France', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('France métropolitaine', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); @@ -57,9 +58,10 @@ public function testGeocodeWithRealAddress() $this->assertNull($result->getPostalCode()); $this->assertNull($result->getSubLocality()); $this->assertNull($result->getLocality()); - $this->assertEquals('Paris', $result->getCounty()->getName()); - $this->assertEquals('Île-de-France', $result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Paris', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Île-de-France', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('France métropolitaine', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); @@ -78,9 +80,10 @@ public function testGeocodeWithRealAddress() $this->assertNull($result->getPostalCode()); $this->assertNull($result->getSubLocality()); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Logan County', $result->getCounty()->getName()); - $this->assertEquals('Arkansas', $result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Logan County', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Arkansas', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('United States of America', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); @@ -99,9 +102,10 @@ public function testGeocodeWithRealAddress() $this->assertNull($result->getPostalCode()); $this->assertNull($result->getSubLocality()); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Lamar County', $result->getCounty()->getName()); - $this->assertEquals('Texas', $result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Lamar County', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Texas', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('United States of America', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); @@ -120,9 +124,10 @@ public function testGeocodeWithRealAddress() $this->assertNull($result->getPostalCode()); $this->assertNull($result->getSubLocality()); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Bourbon County', $result->getCounty()->getName()); - $this->assertEquals('Kentucky', $result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Bourbon County', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Kentucky', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('United States of America', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); } @@ -150,9 +155,10 @@ public function testGeocodeWithRealAddressWithLocale() $this->assertEquals('63170', $result->getPostalCode()); $this->assertEquals('La Pardieu', $result->getSubLocality()); $this->assertEquals('Clermont-Ferrand', $result->getLocality()); - $this->assertEquals('Clermont-Ferrand', $result->getCounty()->getName()); - $this->assertEquals('Auvergne', $result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Clermont-Ferrand', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Auvergne', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('France', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); @@ -171,9 +177,10 @@ public function testGeocodeWithRealAddressWithLocale() $this->assertEquals('63170', $result->getPostalCode()); $this->assertEquals('Cap Sud', $result->getSubLocality()); $this->assertEquals('Aubière', $result->getLocality()); - $this->assertEquals('Clermont-Ferrand', $result->getCounty()->getName()); - $this->assertEquals('Auvergne', $result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Clermont-Ferrand', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Auvergne', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('France', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); } @@ -197,8 +204,9 @@ public function testReverseWithRealCoordinates() $this->assertEquals(20100, $result->getPostalCode()); $this->assertEquals('VII', $result->getSubLocality()); $this->assertEquals('Turku', $result->getLocality()); - $this->assertEquals('Lounais-Suomen aluehallintovirasto', $result->getRegion()->getName()); - $this->assertNull( $result->getRegion()->getCode()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Lounais-Suomen aluehallintovirasto', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull( $result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('Suomi', $result->getCountry()->getName()); $this->assertEquals('FI', $result->getCountry()->getCode()); } @@ -236,9 +244,10 @@ public function testReverseWithRealCoordinatesWithLocale() $this->assertEquals(60437, $result->getPostalCode()); $this->assertEquals('Kalbach', $result->getSubLocality()); $this->assertEquals('Frankfurt am Main', $result->getLocality()); - $this->assertEquals('Frankfurt am Main', $result->getCounty()->getName()); - $this->assertEquals('Hessen', $result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Frankfurt am Main', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Hessen', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('Deutschland', $result->getCountry()->getName()); $this->assertEquals('DE', $result->getCountry()->getCode()); @@ -257,9 +266,10 @@ public function testReverseWithRealCoordinatesWithLocale() $this->assertEquals(60437, $result->getPostalCode()); $this->assertEquals('Bonames', $result->getSubLocality()); $this->assertEquals('Frankfurt am Main', $result->getLocality()); - $this->assertEquals('Frankfurt am Main', $result->getCounty()->getName()); - $this->assertEquals('Hessen', $result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Frankfurt am Main', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Hessen', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('Deutschland', $result->getCountry()->getName()); $this->assertEquals('DE', $result->getCountry()->getCode()); @@ -278,9 +288,10 @@ public function testReverseWithRealCoordinatesWithLocale() $this->assertEquals(60437, $result->getPostalCode()); $this->assertEquals('Kalbach', $result->getSubLocality()); $this->assertEquals('Frankfurt am Main', $result->getLocality()); - $this->assertEquals('Frankfurt am Main', $result->getCounty()->getName()); - $this->assertEquals('Hessen', $result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Frankfurt am Main', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Hessen', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('Deutschland', $result->getCountry()->getName()); $this->assertEquals('DE', $result->getCountry()->getCode()); @@ -299,9 +310,10 @@ public function testReverseWithRealCoordinatesWithLocale() $this->assertEquals(60437, $result->getPostalCode()); $this->assertEquals('Kalbach', $result->getSubLocality()); $this->assertEquals('Frankfurt am Main', $result->getLocality()); - $this->assertEquals('Frankfurt am Main', $result->getCounty()->getName()); - $this->assertEquals('Hessen', $result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Frankfurt am Main', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Hessen', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('Deutschland', $result->getCountry()->getName()); $this->assertEquals('DE', $result->getCountry()->getCode()); } @@ -318,8 +330,7 @@ public function testGeocodeWithLocalhostIPv4() $result = $results->first(); $this->assertInstanceOf('\Geocoder\Model\Address', $result); $this->assertEquals('localhost', $result->getLocality()); - $this->assertEquals('localhost', $result->getCounty()->getName()); - $this->assertEquals('localhost', $result->getRegion()->getName()); + $this->assertEmpty($result->getAdminLevels()); $this->assertEquals('localhost', $result->getCountry()->getName()); } @@ -356,9 +367,10 @@ public function testGeocodeWithRealIPv4() $this->assertEquals(31506, $result->getPostalCode()); $this->assertEquals(4, $result->getSubLocality()); $this->assertEquals('Toulouse', $result->getLocality()); - $this->assertEquals('Toulouse', $result->getCounty()->getName()); - $this->assertEquals('Midi-Pyrénées', $result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Toulouse', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Midi-Pyrénées', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('France métropolitaine', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); } @@ -386,9 +398,10 @@ public function testGeocodeWithRealIPv4WithLocale() $this->assertEquals(31506, $result->getPostalCode()); $this->assertEquals(4, $result->getSubLocality()); $this->assertEquals('Toulouse', $result->getLocality()); - $this->assertEquals('Toulouse', $result->getCounty()->getName()); - $this->assertEquals('Midi-Pyrénées', $result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Toulouse', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Midi-Pyrénées', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('Frankrig', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); } diff --git a/tests/Geocoder/Tests/Provider/TomTomTest.php b/tests/Geocoder/Tests/Provider/TomTomTest.php index 35e2a6869..f2ed76d55 100644 --- a/tests/Geocoder/Tests/Provider/TomTomTest.php +++ b/tests/Geocoder/Tests/Provider/TomTomTest.php @@ -101,8 +101,7 @@ public function testGeocodeWithRealAddress() $this->assertNull($result->getPostalCode()); $this->assertEquals('Copenhagen', $result->getLocality()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(0, $result->getAdminLevels()); $this->assertEquals('Denmark', $result->getCountry()->getName()); $this->assertEquals('DNK', $result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); @@ -131,8 +130,7 @@ public function testGeocodeWithRealAddressWithFrenchLocale() $this->assertNull($result->getPostalCode()); $this->assertEquals('Copenhague', $result->getLocality()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(0, $result->getAdminLevels()); $this->assertEquals('Danemark', $result->getCountry()->getName()); $this->assertEquals('DNK', $result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); @@ -161,8 +159,7 @@ public function testGeocodeWithRealAddressWithSwedishLocale() $this->assertNull($result->getPostalCode()); $this->assertEquals('Köpenhamn', $result->getLocality()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(0, $result->getAdminLevels()); $this->assertEquals('Danmark', $result->getCountry()->getName()); $this->assertEquals('DNK', $result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); @@ -191,8 +188,9 @@ public function testGeocodeWithRealAddressReturnsMultipleResults() $this->assertNull($result->getPostalCode()); $this->assertEquals('Paris', $result->getLocality()); $this->assertNull($result->getSubLocality()); - $this->assertEquals('Ile-de-France', $result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Ile-de-France', $result->getAdminLevels()->get(1)->getName()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('France', $result->getCountry()->getName()); $this->assertEquals('FRA', $result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); @@ -203,7 +201,8 @@ public function testGeocodeWithRealAddressReturnsMultipleResults() $this->assertEquals(33.661426, $result->getLatitude(), '', 0.0001); $this->assertEquals(-95.556321, $result->getLongitude(), '', 0.0001); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Texas', $result->getRegion()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Texas', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('United States',$result->getCountry()->getName()); $this->assertEquals('USA', $result->getCountry()->getCode()); @@ -213,7 +212,8 @@ public function testGeocodeWithRealAddressReturnsMultipleResults() $this->assertEquals(36.302754, $result->getLatitude(), '', 0.0001); $this->assertEquals(-88.326359, $result->getLongitude(), '', 0.0001); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Tennessee', $result->getRegion()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Tennessee', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('USA', $result->getCountry()->getCode()); @@ -223,7 +223,8 @@ public function testGeocodeWithRealAddressReturnsMultipleResults() $this->assertEquals(-19.039448, $result->getLatitude(), '', 0.0001); $this->assertEquals(29.560445, $result->getLongitude(), '', 0.0001); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Midlands', $result->getRegion()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Midlands', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Zimbabwe', $result->getCountry()->getName()); $this->assertEquals('ZWE', $result->getCountry()->getCode()); @@ -233,7 +234,8 @@ public function testGeocodeWithRealAddressReturnsMultipleResults() $this->assertEquals(35.292105, $result->getLatitude(), '', 0.0001); $this->assertEquals(-93.729922, $result->getLongitude(), '', 0.0001); $this->assertEquals('Paris', $result->getLocality()); - $this->assertEquals('Arkansas', $result->getRegion()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Arkansas', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('USA', $result->getCountry()->getCode()); } @@ -369,8 +371,7 @@ public function testReverseWithRealCoordinates() $this->assertNull($result->getPostalCode()); $this->assertEquals('20e Arrondissement Paris', $result->getLocality()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(0, $result->getAdminLevels()); $this->assertEquals('France', $result->getCountry()->getName()); $this->assertEquals('FRA', $result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); @@ -399,8 +400,7 @@ public function testGeocodeWithRealCoordinates() $this->assertNull($result->getPostalCode()); $this->assertEquals('Spentrup', $result->getLocality()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getRegion()->getName()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertCount(0, $result->getAdminLevels()); $this->assertEquals('Denmark', $result->getCountry()->getName()); $this->assertEquals('DNK', $result->getCountry()->getCode()); $this->assertNull($result->getTimezone()); diff --git a/tests/Geocoder/Tests/Provider/YandexTest.php b/tests/Geocoder/Tests/Provider/YandexTest.php index 886b3244c..cb7c83c18 100644 --- a/tests/Geocoder/Tests/Provider/YandexTest.php +++ b/tests/Geocoder/Tests/Provider/YandexTest.php @@ -106,7 +106,8 @@ public function testGeocodeWithRealAddress() $this->assertEquals(2.391064, $result->getBounds()->getEast(), '', 0.01); $this->assertEquals(10, $result->getStreetNumber()); $this->assertEquals('Avenue Gambetta', $result->getStreetName()); - $this->assertEquals('Иль-Де-Франс', $result->getRegion()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Иль-Де-Франс', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Франция', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); @@ -114,7 +115,7 @@ public function testGeocodeWithRealAddress() $this->assertNull($result->getPostalCode()); $this->assertNull($result->getSubLocality()); $this->assertNull($result->getLocality()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getTimezone()); /** @var \Geocoder\Model\Address $result */ @@ -163,14 +164,15 @@ public function testGeocodeWithRealAddressWithUALocale() $this->assertNull($result->getStreetNumber()); $this->assertNull($result->getStreetName()); $this->assertEquals('Копенгаген', $result->getLocality()); - $this->assertEquals('Столичная область', $result->getRegion()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Столичная область', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Данія', $result->getCountry()->getName()); $this->assertEquals('DK', $result->getCountry()->getCode()); // not provided $this->assertNull($result->getPostalCode()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getTimezone()); /** @var \Geocoder\Model\Address $result */ @@ -219,14 +221,15 @@ public function testGeocodeWithRealAddressWithUSLocale() $this->assertNull($result->getStreetNumber()); $this->assertEquals('Pennsylvania Ave NW', $result->getStreetName()); $this->assertEquals('Washington', $result->getLocality()); - $this->assertEquals('District of Columbia', $result->getRegion()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('District of Columbia', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); // not provided $this->assertNull($result->getPostalCode()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getTimezone()); } @@ -251,14 +254,13 @@ public function testGeocodeWithRealAddressWithBYLocale() $this->assertEquals(19, $result->getStreetNumber()); $this->assertEquals('улица Ленина', $result->getStreetName()); $this->assertEquals('Минск', $result->getLocality()); - $this->assertNull($result->getRegion()->getName()); $this->assertEquals('Беларусь', $result->getCountry()->getName()); $this->assertEquals('BY', $result->getCountry()->getCode()); // not provided $this->assertNull($result->getPostalCode()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertEmpty($result->getAdminLevels()); $this->assertNull($result->getTimezone()); } @@ -312,7 +314,8 @@ public function testReverseWithRealCoordinates() $this->assertEquals(2.423214, $result->getBounds()->getEast(), '', 0.01); $this->assertNull($result->getStreetNumber()); $this->assertEquals('Avenue Gambetta', $result->getStreetName()); - $this->assertEquals('Иль-Де-Франс', $result->getRegion()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Иль-Де-Франс', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Франция', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); @@ -320,7 +323,7 @@ public function testReverseWithRealCoordinates() $this->assertNull($result->getPostalCode()); $this->assertNull($result->getSubLocality()); $this->assertNull($result->getLocality()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getTimezone()); /** @var \Geocoder\Model\Address $result */ @@ -356,7 +359,8 @@ public function testReverseWithRealCoordinatesWithUSLocaleAndStreeToponym() $this->assertEquals(2.423214, $result->getBounds()->getEast(), '', 0.01); $this->assertNull($result->getStreetNumber()); $this->assertEquals('Avenue Gambetta', $result->getStreetName()); - $this->assertEquals('Ile-de-France', $result->getRegion()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Ile-de-France', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('France', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); @@ -364,7 +368,7 @@ public function testReverseWithRealCoordinatesWithUSLocaleAndStreeToponym() $this->assertNull($result->getPostalCode()); $this->assertNull($result->getSubLocality()); $this->assertNull($result->getLocality()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getTimezone()); /** @var \Geocoder\Model\Address $result */ @@ -413,14 +417,15 @@ public function testReverseWithRealCoordinatesWithUALocaleAndHouseToponym() $this->assertEquals(36, $result->getStreetNumber()); $this->assertEquals('Ratapihankatu', $result->getStreetName()); $this->assertEquals('Турку', $result->getLocality()); - $this->assertEquals('Исконная Финляндия', $result->getRegion()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Исконная Финляндия', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Фінляндія', $result->getCountry()->getName()); $this->assertEquals('FI', $result->getCountry()->getCode()); // not provided $this->assertNull($result->getPostalCode()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getTimezone()); } @@ -445,14 +450,15 @@ public function testReverseWithRealCoordinatesWithTRLocaleAndLocalityToponym() $this->assertNull($result->getStreetName()); $this->assertNull($result->getStreetNumber()); $this->assertEquals('Dragos', $result->getLocality()); - $this->assertEquals('İstanbul', $result->getRegion()->getName()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('İstanbul', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Türkiye', $result->getCountry()->getName()); $this->assertEquals('TR', $result->getCountry()->getCode()); // not provided $this->assertNull($result->getPostalCode()); $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getRegion()->getCode()); + $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getTimezone()); } } From 012cc598e5918c6afd4bbc019e7b820d9e954a0d Mon Sep 17 00:00:00 2001 From: Giorgio Premi Date: Fri, 30 Jan 2015 10:08:52 +0100 Subject: [PATCH 11/17] Fix localhost default tests --- src/Geocoder/Provider/AbstractProvider.php | 2 -- tests/Geocoder/Tests/Provider/AbstractProviderTest.php | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Geocoder/Provider/AbstractProvider.php b/src/Geocoder/Provider/AbstractProvider.php index 0f27bdcde..ea4050fcd 100644 --- a/src/Geocoder/Provider/AbstractProvider.php +++ b/src/Geocoder/Provider/AbstractProvider.php @@ -89,8 +89,6 @@ protected function getLocalhostDefaults() { return [ 'locality' => 'localhost', - 'county' => 'localhost', - 'region' => 'localhost', 'country' => 'localhost', ]; } diff --git a/tests/Geocoder/Tests/Provider/AbstractProviderTest.php b/tests/Geocoder/Tests/Provider/AbstractProviderTest.php index 5a11a8017..967f0510f 100644 --- a/tests/Geocoder/Tests/Provider/AbstractProviderTest.php +++ b/tests/Geocoder/Tests/Provider/AbstractProviderTest.php @@ -19,7 +19,7 @@ public function testGetLocalhostDefaults() $provider = new MockProvider($adapter); $result = $provider->getLocalhostDefaults(); - $this->assertEquals(4, count($result)); + $this->assertEquals(2, count($result)); $this->assertEquals('localhost', $result['locality']); $this->assertEquals('localhost', $result['country']); } From 32f45440099c0283596aadd7aab3ea87d95ba294 Mon Sep 17 00:00:00 2001 From: Giorgio Premi Date: Thu, 5 Feb 2015 18:33:12 +0100 Subject: [PATCH 12/17] Avoid null object in StringFormatter --- src/Geocoder/Formatter/StringFormatter.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Geocoder/Formatter/StringFormatter.php b/src/Geocoder/Formatter/StringFormatter.php index 696380766..9d547c747 100644 --- a/src/Geocoder/Formatter/StringFormatter.php +++ b/src/Geocoder/Formatter/StringFormatter.php @@ -60,11 +60,12 @@ public function format(Address $address, $format) self::TIMEZONE => $address->getTimezone(), ]; - $adminLevels = $address->getAdminLevels(); - $nullAdminLevel = new AdminLevel(null, null, null); - for ($level = 1; $level <= AdminLevelCollection::MAX_LEVEL_DEPTH; ++ $level) { - $adminLevel = $adminLevels->has($level) ? $adminLevels->get($level) : $nullAdminLevel; + $tr[self::ADMIN_LEVEL . $level] = null; + $tr[self::ADMIN_LEVEL_CODE . $level] = null; + } + + foreach ($address->getAdminLevels() as $level => $adminLevel) { $tr[self::ADMIN_LEVEL . $level] = $adminLevel->getName(); $tr[self::ADMIN_LEVEL_CODE . $level] = $adminLevel->getCode(); } From 6ae5a6d8b7d7696ef814d316e5761c14ce2b2736 Mon Sep 17 00:00:00 2001 From: Giorgio Premi Date: Sun, 1 Feb 2015 18:28:42 +0100 Subject: [PATCH 13/17] OpenStreetMap fix postal code and tests --- src/Geocoder/Provider/Nominatim.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Geocoder/Provider/Nominatim.php b/src/Geocoder/Provider/Nominatim.php index 7bb0590f8..d1a73d24b 100644 --- a/src/Geocoder/Provider/Nominatim.php +++ b/src/Geocoder/Provider/Nominatim.php @@ -116,10 +116,15 @@ private function xmlResultToArray(\DOMElement $resultNode, \DOMElement $addressN } } + // get the first postal-code when there are many + $postalCode = current(explode(';', + $this->getNodeValue($addressNode->getElementsByTagName('postcode')) + )); + $result = [ 'latitude' => $resultNode->getAttribute('lat'), 'longitude' => $resultNode->getAttribute('lon'), - 'postalCode' => $this->getNodeValue($addressNode->getElementsByTagName('postcode')), + 'postalCode' => $postalCode, 'adminLevels' => $adminLevels, 'streetNumber' => $this->getNodeValue($addressNode->getElementsByTagName('house_number')), 'streetName' => $this->getNodeValue($addressNode->getElementsByTagName('road')) ?: $this->getNodeValue($addressNode->getElementsByTagName('pedestrian')), From 9366ff15d95afc667e158199847d5660aa0e5c52 Mon Sep 17 00:00:00 2001 From: Giorgio Premi Date: Thu, 5 Feb 2015 20:34:40 +0100 Subject: [PATCH 14/17] Fix Gpx dumper for adminLevels --- src/Geocoder/Dumper/Gpx.php | 22 ++++++++++++---------- tests/Geocoder/Tests/Dumper/GpxTest.php | 15 ++++++++++----- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/Geocoder/Dumper/Gpx.php b/src/Geocoder/Dumper/Gpx.php index b4f258b4f..4ce63e877 100644 --- a/src/Geocoder/Dumper/Gpx.php +++ b/src/Geocoder/Dumper/Gpx.php @@ -69,20 +69,22 @@ public function dump(Address $address) */ protected function formatName(Address $address) { - $name = ''; + $name = []; $array = $address->toArray(); - $attrs = array('streetNumber', 'streetName', 'postalCode', 'locality', 'county', 'region', 'country'); + $attrs = [ + ['streetNumber'], + ['streetName'], + ['postalCode'], + ['locality'], + ['adminLevels', 2, 'name'], + ['adminLevels', 1, 'name'], + ['country'], + ]; foreach ($attrs as $attr) { - if (isset($array[$attr]) && !empty($array[$attr])) { - $name .= sprintf('%s, ', $array[$attr]); - } + $name[] = \igorw\get_in($array, $attr); } - if (strlen($name) > 1) { - $name = substr($name, 0, strlen($name) - 2); - } - - return $name; + return implode(', ', array_filter($name)); } } diff --git a/tests/Geocoder/Tests/Dumper/GpxTest.php b/tests/Geocoder/Tests/Dumper/GpxTest.php index 091d71a47..f8514753a 100644 --- a/tests/Geocoder/Tests/Dumper/GpxTest.php +++ b/tests/Geocoder/Tests/Dumper/GpxTest.php @@ -120,10 +120,15 @@ public function testDumpWithName() 'east' => 2.388911); $address = $this->createAddress([ - 'latitude' => 48.8631507, - 'longitude' => 2.3889114, - 'bounds' => $bounds, - 'locality' => 'Paris', + 'latitude' => 48.8631507, + 'longitude' => 2.3889114, + 'bounds' => $bounds, + 'locality' => 'Paris', + 'streetName' => 'Avenue Gambetta', + 'streetNumber' => '10', + 'subLocality' => '20e Arrondissement', + 'adminLevels' => [['level' => 1, 'name' => 'Ile-de-France']], + 'country' => 'France' ]); $expected = sprintf(<< - + From 34284c24d6f2c465ee610aed2d61aab2261208e0 Mon Sep 17 00:00:00 2001 From: Giorgio Premi Date: Sun, 1 Feb 2015 16:57:50 +0100 Subject: [PATCH 15/17] Http cache hashing doesn't depend from apikey --- src/Geocoder/Provider/FreeGeoIp.php | 2 +- .../046c839cd520cf5d99862fcb105a38b635ecfd67 | 35 -- .../078fa26249647f012c8c6bd8b5f0f7350d2a326c | 6 +- .../07cc30bd9868a729b3526f85cac0a4dee829eeb7 | 2 +- .../0cbfc638a86c38113c45548bb3655ccb78e5b02e | 78 ---- .../0fe231d2d035e3995ca8781da2ed65f61cd7bc37 | 1 - .../10d59f96256e4f915a4e050350dcee48979fdd60 | 4 - .../125a55420bbd96e209e065acbb058d368c374199 | 1 - .../1517375d8e82387124d1d0ed45d0d8157a2eab3c | 1 - .../15fa9c272dd9ce0e678a0e3ceecfa4bb9e893a41 | 1 - .../1763277712d0dcbf4aa5aaa9b80366e272fc7fb1 | 9 - ... 1a602fb4b503dc7750b4ba1bbe0d7df8f3f2cc97} | 2 +- .../1c5bb23ad45167fa9d48bb8cb6a3dbda630d5bc4 | 20 +- .../1c6d409ea3f33b963904640da05e4fa03acdaaee | 1 + .../1ec836744699c92949abd980774e110560bc27b3 | 3 +- .../2070f9c076c77cfc765be660b209d47ee9846762 | 11 - ... 2215bf948357a4049640a7e6cce1eca1b6bace39} | 2 +- .../238d73130d78d936d4e861b87cce62e9e3dbb585 | 1 - .../2574881cbb127d2489bfa79c4e7ac99356045946 | 28 +- .../25f2875e5d5e2604c081724fe933ddd626cb95c1 | 1 - ... 2b4f3a47fa3f17ffd4b8ebd05d1beeb991f7b77a} | 2 +- .../2b7917a77f7f2c7a527c31c405ef28f5a5268414 | 1 - .../2c024cb7bd51af442a29294a4f9d753dce871a36 | 11 - .../2f3ed3ae641669ffaca8bf883feb1705e8492e6c | 1 - .../2f8e7075736ee6b9e1b9ad0e630889a2cbc518a2 | 1 - .../3117e4255511124c8c1a097f85f1cad5ae01437f | 3 +- ... 32ae7d88654feada04b47acc206701b989f062a0} | 0 .../334d6dcd0369e1f7e7291ce6a01d2aa4e8a3b3ee | 1 - .../3995c1e685bc49f4ff18bdb4f9c54f82adffc511 | 1 - .../3b3fbaa39a76b6bd256d617f4a570ddb7bbe8091 | 11 - ... 3be7f42ac361de5b9bd9baa64a1e21d3fabbe109} | 30 +- ... 3e262b0d16f709138ab5c27e5ae7009df27e692b} | 2 +- .../3e5946648cee4777431d757281bad6d023a22b3f | 11 - .../40a56f7770fc2a796eb01fc984f89a46eaeb3ad0 | 28 +- ... 415bd5046e65920c11f0b065db29d919cc956e46} | 2 +- .../44b73d9a4f187d8a30b1583fef046508069c4feb | 9 - .../49b4c4c3f4eddcff2761213b050ef33cc8c50db3 | 69 --- ... 4b209c50e1a1572c76e2700fc70399d4f173a621} | 2 +- .../4d379baf1d6bff9d4918f098c495a5d79ddabed6 | 1 + .../4e7ce2b76b1ff075f3321fa338f14e4a69889a84 | 9 - ... 54c426ed3f2869a1b52d74736ddbed5280b87762} | 110 +++-- .../550269b02d4e7b169acc513d86f0498d2f42d064 | 2 +- .../5508e82fab1b2602a2125179fcb1a5d175bab9dc | 1 + ... 563c0ee41772350b9055aaef1ef92330f1e6d698} | 0 .../57b9558f363cbecf50955298cf92148e7bf4093c | 6 +- .../58a6cd7c553341f996bbbd6cfe01ce27c87c055d | 35 -- .../5cd188e0df96f4069ca38190fb38b53681dac5e6 | 2 +- .../5e542f2d489819bf630880fe3703ad51881dd472 | 1 - ... 626469fcef9b339686ba97899b36e1861c5d8002} | 0 .../63381be06387797543fe6786a5e5da7a14aaf52a | 147 ------ .../641a9483a3b05446b0e71d9cd117d77661e4701b | 219 --------- ... 666c1a5489aef43598b1248853f404ce735a178e} | 4 +- ... 669625b0fc6af9725bd51c74781228e3746265b7} | 70 ++- .../6a7bf47b3d523a1d34f7c4e8801a0fbde5d819f4 | 2 +- .../6c34e56e6e09ba3fb9fe3000ff7a290db6f3d9f8 | 226 ---------- .../6c631da4e9548c0b1e68c16f80cdfe51f0fa4e06 | 1 - ... 6c6fa0f2c6632ec68d3d240ea0c17713093a32f7} | 0 .../6e0f46692b3ef7e83b4e947928c3e5b4fb5e4248 | 1 + .../6f34a1eb48a97017a08e289b88e103eabd9581e9 | 1 - .../6fee0a856bf599a641fc9edf71b3f0c8f80403d5 | 16 - ... 72a69855f28b41522dde9af4db6245333617ca27} | 2 +- .../753d61c7c991002e790dd6f22f6914486945180c | 1 - .../786e1f4aed741c35447d26408ed53ec2e3cc1998 | 6 +- .../7935ce6e64b9430cb55c248f598759370367b0dc | 9 - .../79bff4e0349cf851754db4dd986e18242ca84428 | 1 + .../806c75f6fe97faa322b1431647bd475f581878fc | 10 +- .../867454f52ff07ab403df7cb308d961e25e54dea3 | 2 +- .../87d9131d36cefc486b1726e833c6e852ab44c929 | 1 + .../8818e01b5730caaa37d6e7c04cd6f020e93bb8cd | 2 +- .../88407af65febe0eeb74e18eadadfd8d33a05a7e8 | 9 - .../8eae3cccf86aedb7e793a3ef464e5e4ac91adaff | 1 - .../8fa395e80c0be73710869507b0e0cdf336c7d391 | 291 ------------ .../8fe0b54dc231a396a65c35bc2acd58c1abf3f636 | 1 - .../965146c2ba972feb059e57b7319d519cc749d771 | 1 + ... 96ae7399b6a2153e8d2c7d11829830f2711efb9f} | 0 .../97387ac4fe9d9965f0e431afef9a7658bc37d0db | 4 +- ... 997bf83a1e8720db46bcd6d6014582d4adeddda0} | 0 ... a6f5a65e97797392de77ec60d1e9ad9d457144a4} | 0 .../a94552b2855c3efa518351bb1adc29bbfca0278f | 1 - ... aafd96b49c2dfb6251cfed2cc9e68f202e15ecf6} | 2 +- .../ad6d784a78e64873da11acf325e3fbe50b7ba469 | 1 - ... adef4e872257cb73774056a6462601a02cdbcb5a} | 110 +++-- .../b1904b6be00241aeb68e1c59349434f0c985ca51 | 1 - .../b4058fb568f89b9c4983e6aa2f32b4cd08ea74ba | 1 - .../b4b2d13284994cec6e72bdf72a17ae8ee713888a | 1 + .../b5d39db33bc9c80e313ac2be24e744f86f48f286 | 13 - .../b5d692ab2cba63003d06933655016a406d04dbcf | 2 +- ... ba69ac95396013dc9abd1342b1132a4027939ede} | 50 ++- .../bb59351faf44013198f2879892f74e768e585758 | 1 - .../c181c3f0f0d308dcf59024b03a203f30bb24a7df | 2 +- ... c1d00538a725d3dbb2aaaa3add8e5cc789a1aa02} | 0 .../c307fb40fcd224cbba28992874b8203f0a9da80a | 100 ----- .../c3487c0fe92a00d80eab35b6b3c5bfe916dd11c0 | 1 - .../c5841aae4eeef01eabc1469c69495f04c2da175c | 35 -- .../c61162fb20c07fed396ed94540f32cc38159267c | 69 --- .../c972187b27aae0b606ca03e34af04cf70c016b87 | 13 - .../d1444e22b66656521510faf98ab2d984e0352d9a | 16 +- .../d231745e9f80a2fabc1b38ff3787166a38877d00 | 425 ------------------ .../d5acce58382374896160a6a9f0ffc48e1fe07d03 | 12 - .../d7947e75e249cdfc9010c23f7e752c98f0eda7f5 | 2 +- .../d7ed302d16c33755c09f2ac3998f4fdf70b95912 | 14 +- .../dbc2472eae0fd53e95b4ab4a83a9079e2b0f6824 | 1 - .../dbef79f429e3074bdda011e1980502694ec767fb | 1 - .../e0459136e9e4437af8bac88a11ce7be70c4e2d59 | 1 - ... e2294089df3badb1749aeb75f2d34e457d340523} | 6 +- .../e5916045d0969dfeae7695f420e25b7aa25a8ab1 | 1 - .../e87d8c9a4e4b632a9125ce6378e5271b6da57b0b | 11 - .../eb8f398c5fe9b5bfa00e1611560b695ca8f4eb66 | 69 --- .../ee00f7c2fd65e8e92f665093c5c2b81cb49a3bd6 | 19 - .../f0553f89054916e8c2104cb4acf3595417e9716a | 14 - .../f5c2c376bcb725d2d715f659951cadf2043da287 | 4 +- .../f5d2e0cbbeedb1628cb53a37ff06416e636d367d | 4 - .../fd8ebeaaba96a9f801a70a96d33b7a6908b8a9ad | 11 - .../fdc140c25fa42d21dac27f6e9a389d7695a64b78 | 59 --- ... ff149227816fd8aa631f7bb4adc09725bc839493} | 2 +- .../Geocoder/Tests/CachedResponseAdapter.php | 11 +- .../Geocoder/Tests/Provider/BingMapsTest.php | 10 +- .../Geocoder/Tests/Provider/FreeGeoIpTest.php | 8 +- tests/Geocoder/Tests/Provider/GeoIPsTest.php | 4 +- .../Geocoder/Tests/Provider/GeonamesTest.php | 8 +- .../Tests/Provider/GoogleMapsTest.php | 2 +- .../Geocoder/Tests/Provider/IpInfoDbTest.php | 6 +- .../Geocoder/Tests/Provider/MapQuestTest.php | 8 +- tests/Geocoder/Tests/Provider/MaxMindTest.php | 10 +- .../Geocoder/Tests/Provider/OpenCageTest.php | 10 +- .../Tests/Provider/OpenStreetMapTest.php | 29 +- tests/Geocoder/Tests/Provider/TomTomTest.php | 12 +- tests/Geocoder/Tests/Provider/YandexTest.php | 95 ++-- tests/Geocoder/Tests/TestCase.php | 4 +- 129 files changed, 445 insertions(+), 2436 deletions(-) delete mode 100644 tests/.cached_responses/046c839cd520cf5d99862fcb105a38b635ecfd67 delete mode 100644 tests/.cached_responses/0cbfc638a86c38113c45548bb3655ccb78e5b02e delete mode 100644 tests/.cached_responses/0fe231d2d035e3995ca8781da2ed65f61cd7bc37 delete mode 100644 tests/.cached_responses/10d59f96256e4f915a4e050350dcee48979fdd60 delete mode 100644 tests/.cached_responses/125a55420bbd96e209e065acbb058d368c374199 delete mode 100644 tests/.cached_responses/1517375d8e82387124d1d0ed45d0d8157a2eab3c delete mode 100644 tests/.cached_responses/15fa9c272dd9ce0e678a0e3ceecfa4bb9e893a41 delete mode 100644 tests/.cached_responses/1763277712d0dcbf4aa5aaa9b80366e272fc7fb1 rename tests/.cached_responses/{49dcfe5f96e6289f277276a09fb3b26f353e2c8d => 1a602fb4b503dc7750b4ba1bbe0d7df8f3f2cc97} (95%) create mode 100644 tests/.cached_responses/1c6d409ea3f33b963904640da05e4fa03acdaaee delete mode 100644 tests/.cached_responses/2070f9c076c77cfc765be660b209d47ee9846762 rename tests/.cached_responses/{b0b4edb754ec522d7b4ba93b159fa9b68e628393 => 2215bf948357a4049640a7e6cce1eca1b6bace39} (85%) delete mode 100644 tests/.cached_responses/238d73130d78d936d4e861b87cce62e9e3dbb585 delete mode 100644 tests/.cached_responses/25f2875e5d5e2604c081724fe933ddd626cb95c1 rename tests/.cached_responses/{f00adac5ecd9df04488077c3b48b382a3aa6bf9f => 2b4f3a47fa3f17ffd4b8ebd05d1beeb991f7b77a} (89%) delete mode 100644 tests/.cached_responses/2b7917a77f7f2c7a527c31c405ef28f5a5268414 delete mode 100644 tests/.cached_responses/2c024cb7bd51af442a29294a4f9d753dce871a36 delete mode 100644 tests/.cached_responses/2f3ed3ae641669ffaca8bf883feb1705e8492e6c delete mode 100644 tests/.cached_responses/2f8e7075736ee6b9e1b9ad0e630889a2cbc518a2 rename tests/.cached_responses/{4f5cc7e59037868ffefe62f12e367592fdd3eafe => 32ae7d88654feada04b47acc206701b989f062a0} (100%) delete mode 100644 tests/.cached_responses/334d6dcd0369e1f7e7291ce6a01d2aa4e8a3b3ee delete mode 100644 tests/.cached_responses/3995c1e685bc49f4ff18bdb4f9c54f82adffc511 delete mode 100644 tests/.cached_responses/3b3fbaa39a76b6bd256d617f4a570ddb7bbe8091 rename tests/.cached_responses/{288c9c8fffb736b97f92c54e551d79637d3d99f8 => 3be7f42ac361de5b9bd9baa64a1e21d3fabbe109} (78%) rename tests/.cached_responses/{5d81702425bd32b235bca9e95467c97fb9e8f9e7 => 3e262b0d16f709138ab5c27e5ae7009df27e692b} (93%) delete mode 100644 tests/.cached_responses/3e5946648cee4777431d757281bad6d023a22b3f rename tests/.cached_responses/{f2c2aa8eb877d1ae29c3b1c3f8bcb895b73e19d1 => 415bd5046e65920c11f0b065db29d919cc956e46} (51%) delete mode 100644 tests/.cached_responses/44b73d9a4f187d8a30b1583fef046508069c4feb delete mode 100644 tests/.cached_responses/49b4c4c3f4eddcff2761213b050ef33cc8c50db3 rename tests/.cached_responses/{e784f2f96e2a26b406daa8fe4fe12e814eb63f4e => 4b209c50e1a1572c76e2700fc70399d4f173a621} (96%) create mode 100644 tests/.cached_responses/4d379baf1d6bff9d4918f098c495a5d79ddabed6 delete mode 100644 tests/.cached_responses/4e7ce2b76b1ff075f3321fa338f14e4a69889a84 rename tests/.cached_responses/{7872917011857c419d626afc4e9e42674eeec00c => 54c426ed3f2869a1b52d74736ddbed5280b87762} (74%) create mode 100644 tests/.cached_responses/5508e82fab1b2602a2125179fcb1a5d175bab9dc rename tests/.cached_responses/{2dc5ff095533a97d537c2f9daedff80820f88294 => 563c0ee41772350b9055aaef1ef92330f1e6d698} (100%) delete mode 100644 tests/.cached_responses/58a6cd7c553341f996bbbd6cfe01ce27c87c055d delete mode 100644 tests/.cached_responses/5e542f2d489819bf630880fe3703ad51881dd472 rename tests/.cached_responses/{007b18894c37cb365c2364dd1dad71b20e0e57dc => 626469fcef9b339686ba97899b36e1861c5d8002} (100%) delete mode 100644 tests/.cached_responses/63381be06387797543fe6786a5e5da7a14aaf52a delete mode 100644 tests/.cached_responses/641a9483a3b05446b0e71d9cd117d77661e4701b rename tests/.cached_responses/{4abafe29c2864454fe15204bd400785d4d8091ee => 666c1a5489aef43598b1248853f404ce735a178e} (97%) rename tests/.cached_responses/{9ad0226c913e90e9bc8ae8c87b0a5156bf8cbd9b => 669625b0fc6af9725bd51c74781228e3746265b7} (74%) delete mode 100644 tests/.cached_responses/6c34e56e6e09ba3fb9fe3000ff7a290db6f3d9f8 delete mode 100644 tests/.cached_responses/6c631da4e9548c0b1e68c16f80cdfe51f0fa4e06 rename tests/.cached_responses/{7b6ca05d2ae5285a113067a9967f856723b3b99e => 6c6fa0f2c6632ec68d3d240ea0c17713093a32f7} (100%) create mode 100644 tests/.cached_responses/6e0f46692b3ef7e83b4e947928c3e5b4fb5e4248 delete mode 100644 tests/.cached_responses/6f34a1eb48a97017a08e289b88e103eabd9581e9 delete mode 100644 tests/.cached_responses/6fee0a856bf599a641fc9edf71b3f0c8f80403d5 rename tests/.cached_responses/{44a67d2e565f1ac9d0c2e32cb6d8fe68e9c169ca => 72a69855f28b41522dde9af4db6245333617ca27} (85%) delete mode 100644 tests/.cached_responses/753d61c7c991002e790dd6f22f6914486945180c delete mode 100644 tests/.cached_responses/7935ce6e64b9430cb55c248f598759370367b0dc create mode 100644 tests/.cached_responses/79bff4e0349cf851754db4dd986e18242ca84428 create mode 100644 tests/.cached_responses/87d9131d36cefc486b1726e833c6e852ab44c929 delete mode 100644 tests/.cached_responses/88407af65febe0eeb74e18eadadfd8d33a05a7e8 delete mode 100644 tests/.cached_responses/8eae3cccf86aedb7e793a3ef464e5e4ac91adaff delete mode 100644 tests/.cached_responses/8fa395e80c0be73710869507b0e0cdf336c7d391 delete mode 100644 tests/.cached_responses/8fe0b54dc231a396a65c35bc2acd58c1abf3f636 create mode 100644 tests/.cached_responses/965146c2ba972feb059e57b7319d519cc749d771 rename tests/.cached_responses/{b75d88797972f5ac9c69e1236aebbd390002c3bf => 96ae7399b6a2153e8d2c7d11829830f2711efb9f} (100%) rename tests/.cached_responses/{fbed818d3fb568414d3fc7bd329473f6b9ed3b76 => 997bf83a1e8720db46bcd6d6014582d4adeddda0} (100%) rename tests/.cached_responses/{2f533a08ae0b6ca65e06bd8dd13f1ef50e94bba0 => a6f5a65e97797392de77ec60d1e9ad9d457144a4} (100%) delete mode 100644 tests/.cached_responses/a94552b2855c3efa518351bb1adc29bbfca0278f rename tests/.cached_responses/{9c19e1181083e48a07d9a4f45930541d22cf3b07 => aafd96b49c2dfb6251cfed2cc9e68f202e15ecf6} (90%) delete mode 100644 tests/.cached_responses/ad6d784a78e64873da11acf325e3fbe50b7ba469 rename tests/.cached_responses/{ec3b49108dc2f482da5a31f580522026fdf9816d => adef4e872257cb73774056a6462601a02cdbcb5a} (75%) delete mode 100644 tests/.cached_responses/b1904b6be00241aeb68e1c59349434f0c985ca51 delete mode 100644 tests/.cached_responses/b4058fb568f89b9c4983e6aa2f32b4cd08ea74ba create mode 100644 tests/.cached_responses/b4b2d13284994cec6e72bdf72a17ae8ee713888a delete mode 100644 tests/.cached_responses/b5d39db33bc9c80e313ac2be24e744f86f48f286 rename tests/.cached_responses/{9ffb332bcb4007420b0688f0f97bfa983106fa6b => ba69ac95396013dc9abd1342b1132a4027939ede} (73%) delete mode 100644 tests/.cached_responses/bb59351faf44013198f2879892f74e768e585758 rename tests/.cached_responses/{6364b609fe439db7a23a0c295073d3c75f9a39bd => c1d00538a725d3dbb2aaaa3add8e5cc789a1aa02} (100%) delete mode 100644 tests/.cached_responses/c307fb40fcd224cbba28992874b8203f0a9da80a delete mode 100644 tests/.cached_responses/c3487c0fe92a00d80eab35b6b3c5bfe916dd11c0 delete mode 100644 tests/.cached_responses/c5841aae4eeef01eabc1469c69495f04c2da175c delete mode 100644 tests/.cached_responses/c61162fb20c07fed396ed94540f32cc38159267c delete mode 100644 tests/.cached_responses/c972187b27aae0b606ca03e34af04cf70c016b87 delete mode 100644 tests/.cached_responses/d231745e9f80a2fabc1b38ff3787166a38877d00 delete mode 100644 tests/.cached_responses/d5acce58382374896160a6a9f0ffc48e1fe07d03 delete mode 100644 tests/.cached_responses/dbc2472eae0fd53e95b4ab4a83a9079e2b0f6824 delete mode 100644 tests/.cached_responses/dbef79f429e3074bdda011e1980502694ec767fb delete mode 100644 tests/.cached_responses/e0459136e9e4437af8bac88a11ce7be70c4e2d59 rename tests/.cached_responses/{fd67cf38c744900c2fbaff37ee04f5cbd04a9345 => e2294089df3badb1749aeb75f2d34e457d340523} (68%) delete mode 100644 tests/.cached_responses/e5916045d0969dfeae7695f420e25b7aa25a8ab1 delete mode 100644 tests/.cached_responses/e87d8c9a4e4b632a9125ce6378e5271b6da57b0b delete mode 100644 tests/.cached_responses/eb8f398c5fe9b5bfa00e1611560b695ca8f4eb66 delete mode 100644 tests/.cached_responses/ee00f7c2fd65e8e92f665093c5c2b81cb49a3bd6 delete mode 100644 tests/.cached_responses/f0553f89054916e8c2104cb4acf3595417e9716a delete mode 100644 tests/.cached_responses/f5d2e0cbbeedb1628cb53a37ff06416e636d367d delete mode 100644 tests/.cached_responses/fd8ebeaaba96a9f801a70a96d33b7a6908b8a9ad delete mode 100644 tests/.cached_responses/fdc140c25fa42d21dac27f6e9a389d7695a64b78 rename tests/.cached_responses/{48f20f73811a6fb236311b5e3f9d9ca044549f80 => ff149227816fd8aa631f7bb4adc09725bc839493} (77%) diff --git a/src/Geocoder/Provider/FreeGeoIp.php b/src/Geocoder/Provider/FreeGeoIp.php index 8a1175c83..eee7325be 100644 --- a/src/Geocoder/Provider/FreeGeoIp.php +++ b/src/Geocoder/Provider/FreeGeoIp.php @@ -82,7 +82,7 @@ private function executeQuery($query) $adminLevels = []; - if (isset($data['region_name']) || isset($data['region_code'])) { + if (! empty($data['region_name']) || ! empty($data['region_code'])) { $adminLevels[] = [ 'name' => isset($data['region_name']) ? $data['region_name'] : null, 'code' => isset($data['region_code']) ? $data['region_code'] : null, diff --git a/tests/.cached_responses/046c839cd520cf5d99862fcb105a38b635ecfd67 b/tests/.cached_responses/046c839cd520cf5d99862fcb105a38b635ecfd67 deleted file mode 100644 index bc2ddf7d1..000000000 --- a/tests/.cached_responses/046c839cd520cf5d99862fcb105a38b635ecfd67 +++ /dev/null @@ -1,35 +0,0 @@ -s:754:" - - - - 40.707507 - -74.011255 - New York - NY - 10005 - 2 - New St - 40.707507 - -74.011255 - 0 - - - - - 40.707507 - -74.011255 - New York - NY - 10005 - 2 - New St - 40.707507 - -74.011255 - 0 - - - - - - -"; \ No newline at end of file diff --git a/tests/.cached_responses/078fa26249647f012c8c6bd8b5f0f7350d2a326c b/tests/.cached_responses/078fa26249647f012c8c6bd8b5f0f7350d2a326c index 5ad29e317..19eacb94a 100644 --- a/tests/.cached_responses/078fa26249647f012c8c6bd8b5f0f7350d2a326c +++ b/tests/.cached_responses/078fa26249647f012c8c6bd8b5f0f7350d2a326c @@ -1,4 +1,4 @@ -s:2067:"{ +s:2091:"{ "results" : [ { "address_components" : [ @@ -15,7 +15,7 @@ s:2067:"{ { "long_name" : "Kalbach-Riedberg", "short_name" : "Kalbach-Riedberg", - "types" : [ "sublocality", "political" ] + "types" : [ "sublocality_level_1", "sublocality", "political" ] }, { "long_name" : "Frankfurt", @@ -28,7 +28,7 @@ s:2067:"{ "types" : [ "administrative_area_level_2", "political" ] }, { - "long_name" : "Hesse", + "long_name" : "Hessen", "short_name" : "HE", "types" : [ "administrative_area_level_1", "political" ] }, diff --git a/tests/.cached_responses/07cc30bd9868a729b3526f85cac0a4dee829eeb7 b/tests/.cached_responses/07cc30bd9868a729b3526f85cac0a4dee829eeb7 index 194c259f6..e527b4834 100644 --- a/tests/.cached_responses/07cc30bd9868a729b3526f85cac0a4dee829eeb7 +++ b/tests/.cached_responses/07cc30bd9868a729b3526f85cac0a4dee829eeb7 @@ -1 +1 @@ -s:4572:"{"response":{"Attribution":"","GeoObjectCollection":{"metaDataProperty":{"GeocoderResponseMetaData":{"request":"22.256784,60.453947","found":"70","results":"5","boundedBy":{"Envelope":{"lowerCorner":"22.254288 60.451449","upperCorner":"22.259283 60.456445"}},"Point":{"pos":"22.256784 60.453947"},"kind":"house"}},"featureMember":[{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Фінляндія, Исконная Финляндия, Турку, Ratapihankatu, 36","precision":"exact","AddressDetails":{"Country":{"AddressLine":"Исконная Финляндия, Турку, Ratapihankatu, 36","CountryNameCode":"FI","CountryName":"Фінляндія","AdministrativeArea":{"AdministrativeAreaName":"Исконная Финляндия","Locality":{"LocalityName":"Турку","Thoroughfare":{"ThoroughfareName":"Ratapihankatu","Premise":{"PremiseNumber":"36"}}}}}}}},"description":"Турку, Исконная Финляндия, Фінляндія","name":"Ratapihankatu, 36","boundedBy":{"Envelope":{"lowerCorner":"22.254513 60.45345","upperCorner":"22.258609 60.455474"}},"Point":{"pos":"22.256561 60.454462"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Фінляндія, Исконная Финляндия, Турку, Bangårdsgatan, 36","precision":"exact","AddressDetails":{"Country":{"AddressLine":"Исконная Финляндия, Турку, Bangårdsgatan, 36","CountryNameCode":"FI","CountryName":"Фінляндія","AdministrativeArea":{"AdministrativeAreaName":"Исконная Финляндия","Locality":{"LocalityName":"Турку","Thoroughfare":{"ThoroughfareName":"Bangårdsgatan","Premise":{"PremiseNumber":"36"}}}}}}}},"description":"Турку, Исконная Финляндия, Фінляндія","name":"Bangårdsgatan, 36","boundedBy":{"Envelope":{"lowerCorner":"22.254513 60.45345","upperCorner":"22.258609 60.455474"}},"Point":{"pos":"22.256561 60.454462"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Фінляндія, Исконная Финляндия, Турку, Ratapihankatu, 40","precision":"exact","AddressDetails":{"Country":{"AddressLine":"Исконная Финляндия, Турку, Ratapihankatu, 40","CountryNameCode":"FI","CountryName":"Фінляндія","AdministrativeArea":{"AdministrativeAreaName":"Исконная Финляндия","Locality":{"LocalityName":"Турку","Thoroughfare":{"ThoroughfareName":"Ratapihankatu","Premise":{"PremiseNumber":"40"}}}}}}}},"description":"Турку, Исконная Финляндия, Фінляндія","name":"Ratapihankatu, 40","boundedBy":{"Envelope":{"lowerCorner":"22.252905 60.452878","upperCorner":"22.257001 60.454901"}},"Point":{"pos":"22.254953 60.453890"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Фінляндія, Исконная Финляндия, Турку, Bangårdsgatan, 40","precision":"exact","AddressDetails":{"Country":{"AddressLine":"Исконная Финляндия, Турку, Bangårdsgatan, 40","CountryNameCode":"FI","CountryName":"Фінляндія","AdministrativeArea":{"AdministrativeAreaName":"Исконная Финляндия","Locality":{"LocalityName":"Турку","Thoroughfare":{"ThoroughfareName":"Bangårdsgatan","Premise":{"PremiseNumber":"40"}}}}}}}},"description":"Турку, Исконная Финляндия, Фінляндія","name":"Bangårdsgatan, 40","boundedBy":{"Envelope":{"lowerCorner":"22.252905 60.452878","upperCorner":"22.257001 60.454901"}},"Point":{"pos":"22.254953 60.453890"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Фінляндія, Исконная Финляндия, Турку, Кескуста, Humalistonkatu, 15b","precision":"exact","AddressDetails":{"Country":{"AddressLine":"Исконная Финляндия, Турку, Кескуста, Humalistonkatu, 15b","CountryNameCode":"FI","CountryName":"Фінляндія","AdministrativeArea":{"AdministrativeAreaName":"Исконная Финляндия","Locality":{"LocalityName":"Турку","DependentLocality":{"DependentLocalityName":"Кескуста","Thoroughfare":{"ThoroughfareName":"Humalistonkatu","Premise":{"PremiseNumber":"15b"}}}}}}}}},"description":"Кескуста, Турку, Исконная Финляндия, Фінляндія","name":"Humalistonkatu, 15b","boundedBy":{"Envelope":{"lowerCorner":"22.253578 60.452128","upperCorner":"22.257675 60.454151"}},"Point":{"pos":"22.255626 60.453140"}}}]}}}"; \ No newline at end of file +s:6233:"{"response":{"Attribution":"","GeoObjectCollection":{"metaDataProperty":{"GeocoderResponseMetaData":{"request":"22.256784,60.453947","found":"70","results":"5","boundedBy":{"Envelope":{"lowerCorner":"22.254288 60.451449","upperCorner":"22.259283 60.456445"}},"Point":{"pos":"22.256784 60.453947"},"kind":"house"}},"featureMember":[{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Фінляндія, Юго-Западная Финляндия, Исконная Финляндия, Турку, Кескуста, Bangårdsgatan, 36","precision":"exact","AddressDetails":{"Country":{"AddressLine":"Юго-Западная Финляндия, Исконная Финляндия, Турку, Кескуста, Bangårdsgatan, 36","CountryNameCode":"FI","CountryName":"Фінляндія","AdministrativeArea":{"AdministrativeAreaName":"Юго-Западная Финляндия","SubAdministrativeArea":{"SubAdministrativeAreaName":"Исконная Финляндия","Locality":{"LocalityName":"Турку","DependentLocality":{"DependentLocalityName":"Кескуста","Thoroughfare":{"ThoroughfareName":"Bangårdsgatan","Premise":{"PremiseNumber":"36"}}}}}}}}}},"description":"Кескуста, Турку, Исконная Финляндия, Юго-Западная Финляндия, Фінляндія","name":"Bangårdsgatan, 36","boundedBy":{"Envelope":{"lowerCorner":"22.248557 60.450242","upperCorner":"22.265014 60.458371"}},"Point":{"pos":"22.256785 60.454307"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Фінляндія, Юго-Западная Финляндия, Исконная Финляндия, Турку, Кескуста, Ratapihankatu, 36","precision":"exact","AddressDetails":{"Country":{"AddressLine":"Юго-Западная Финляндия, Исконная Финляндия, Турку, Кескуста, Ratapihankatu, 36","CountryNameCode":"FI","CountryName":"Фінляндія","AdministrativeArea":{"AdministrativeAreaName":"Юго-Западная Финляндия","SubAdministrativeArea":{"SubAdministrativeAreaName":"Исконная Финляндия","Locality":{"LocalityName":"Турку","DependentLocality":{"DependentLocalityName":"Кескуста","Thoroughfare":{"ThoroughfareName":"Ratapihankatu","Premise":{"PremiseNumber":"36"}}}}}}}}}},"description":"Кескуста, Турку, Исконная Финляндия, Юго-Западная Финляндия, Фінляндія","name":"Ratapihankatu, 36","boundedBy":{"Envelope":{"lowerCorner":"22.248557 60.450242","upperCorner":"22.265014 60.458371"}},"Point":{"pos":"22.256785 60.454307"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Фінляндія, Юго-Западная Финляндия, Исконная Финляндия, Турку, Кескуста, Humalistonkatu, 15b","precision":"exact","AddressDetails":{"Country":{"AddressLine":"Юго-Западная Финляндия, Исконная Финляндия, Турку, Кескуста, Humalistonkatu, 15b","CountryNameCode":"FI","CountryName":"Фінляндія","AdministrativeArea":{"AdministrativeAreaName":"Юго-Западная Финляндия","SubAdministrativeArea":{"SubAdministrativeAreaName":"Исконная Финляндия","Locality":{"LocalityName":"Турку","DependentLocality":{"DependentLocalityName":"Кескуста","Thoroughfare":{"ThoroughfareName":"Humalistonkatu","Premise":{"PremiseNumber":"15b"}}}}}}}}}},"description":"Кескуста, Турку, Исконная Финляндия, Юго-Западная Финляндия, Фінляндія","name":"Humalistonkatu, 15b","boundedBy":{"Envelope":{"lowerCorner":"22.248125 60.449332","upperCorner":"22.264583 60.457461"}},"Point":{"pos":"22.256354 60.453397"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Фінляндія, Юго-Западная Финляндия, Исконная Финляндия, Турку, Кескуста, Humlegårdsgatan, 15b","precision":"exact","AddressDetails":{"Country":{"AddressLine":"Юго-Западная Финляндия, Исконная Финляндия, Турку, Кескуста, Humlegårdsgatan, 15b","CountryNameCode":"FI","CountryName":"Фінляндія","AdministrativeArea":{"AdministrativeAreaName":"Юго-Западная Финляндия","SubAdministrativeArea":{"SubAdministrativeAreaName":"Исконная Финляндия","Locality":{"LocalityName":"Турку","DependentLocality":{"DependentLocalityName":"Кескуста","Thoroughfare":{"ThoroughfareName":"Humlegårdsgatan","Premise":{"PremiseNumber":"15b"}}}}}}}}}},"description":"Кескуста, Турку, Исконная Финляндия, Юго-Западная Финляндия, Фінляндія","name":"Humlegårdsgatan, 15b","boundedBy":{"Envelope":{"lowerCorner":"22.248125 60.449332","upperCorner":"22.264583 60.457461"}},"Point":{"pos":"22.256354 60.453397"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Фінляндія, Юго-Западная Финляндия, Исконная Финляндия, Турку, Кескуста, Humlegårdsgatan, 15a","precision":"exact","AddressDetails":{"Country":{"AddressLine":"Юго-Западная Финляндия, Исконная Финляндия, Турку, Кескуста, Humlegårdsgatan, 15a","CountryNameCode":"FI","CountryName":"Фінляндія","AdministrativeArea":{"AdministrativeAreaName":"Юго-Западная Финляндия","SubAdministrativeArea":{"SubAdministrativeAreaName":"Исконная Финляндия","Locality":{"LocalityName":"Турку","DependentLocality":{"DependentLocalityName":"Кескуста","Thoroughfare":{"ThoroughfareName":"Humlegårdsgatan","Premise":{"PremiseNumber":"15a"}}}}}}}}}},"description":"Кескуста, Турку, Исконная Финляндия, Юго-Западная Финляндия, Фінляндія","name":"Humlegårdsgatan, 15a","boundedBy":{"Envelope":{"lowerCorner":"22.248889 60.449235","upperCorner":"22.265346 60.457364"}},"Point":{"pos":"22.257118 60.453299"}}}]}}}"; \ No newline at end of file diff --git a/tests/.cached_responses/0cbfc638a86c38113c45548bb3655ccb78e5b02e b/tests/.cached_responses/0cbfc638a86c38113c45548bb3655ccb78e5b02e deleted file mode 100644 index 218e58783..000000000 --- a/tests/.cached_responses/0cbfc638a86c38113c45548bb3655ccb78e5b02e +++ /dev/null @@ -1,78 +0,0 @@ -s:2133:"{ - "licenses" : [ - { - "name" : "CC-BY-SA", - "url" : "http://creativecommons.org/licenses/by-sa/3.0/" - }, - { - "name" : "ODbL", - "url" : "http://opendatacommons.org/licenses/odbl/summary/" - } - ], - "rate" : { - "limit" : 2500, - "remaining" : 2448, - "reset" : 1410393600 - }, - "results" : [ - { - "annotations" : { - "OSGB" : { - "easting" : 347696.195, - "gridref" : "SD 476 617", - "northing" : 461750.824 - }, - "OSM" : { - "url" : "http://www.openstreetmap.org/?mlat=54.04888&mlon=-2.79895#map=17/54.04888/-2.79895" - }, - "geohash" : "gcw52r3cec2m35vkre86", - "timezone" : { - "name" : "Europe/London", - "now_in_dst" : 1, - "offset_sec" : 3600, - "offset_string" : 100, - "short_name" : "BST" - } - }, - "bounds" : { - "northeast" : { - "lat" : 54.0494992, - "lng" : -2.79813 - }, - "southwest" : { - "lat" : 54.0482731, - "lng" : -2.7998815 - } - }, - "components" : { - "building" : "St Nicholas Arcades", - "city" : "Lancaster", - "country" : "United Kingdom", - "country_code" : "gb", - "county" : "Lancashire", - "pedestrian" : "Lancaster Gate", - "state" : "England", - "state_district" : "North West England", - "suburb" : "Vale" - }, - "confidence" : 10, - "formatted" : "Lancaster, United Kingdom", - "geometry" : { - "lat" : 54.0488796, - "lng" : -2.79894909568771 - } - } - ], - "status" : { - "code" : 200, - "message" : "OK" - }, - "thanks" : "For using an OpenCage Data API", - "timestamp" : { - "created_http" : "Wed, 10 Sep 2014 21:12:51 GMT", - "created_unix" : 1410383571 - }, - "total_results" : 1, - "we_are_hiring" : "http://lokku.com/#jobs" -} -"; \ No newline at end of file diff --git a/tests/.cached_responses/0fe231d2d035e3995ca8781da2ed65f61cd7bc37 b/tests/.cached_responses/0fe231d2d035e3995ca8781da2ed65f61cd7bc37 deleted file mode 100644 index 77c39527e..000000000 --- a/tests/.cached_responses/0fe231d2d035e3995ca8781da2ed65f61cd7bc37 +++ /dev/null @@ -1 +0,0 @@ -s:2848:"{"authenticationResultCode":"ValidCredentials","brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png","copyright":"Copyright © 2014 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","resourceSets":[{"estimatedTotal":3,"resources":[{"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1","bbox":[48.859354042429317,2.3809438666389395,48.86707947757067,2.3966003933610596],"name":"10 Avenue Gambetta, 75020 Paris","point":{"type":"Point","coordinates":[48.863216759999993,2.3887721299999995]},"address":{"addressLine":"10 Avenue Gambetta","adminDistrict":"IdF","adminDistrict2":"Paris","countryRegion":"France","formattedAddress":"10 Avenue Gambetta, 75020 Paris","locality":"Paris","postalCode":"75020"},"confidence":"Medium","entityType":"Address","geocodePoints":[{"type":"Point","coordinates":[48.863216759999993,2.3887721299999995],"calculationMethod":"Interpolation","usageTypes":["Display","Route"]}],"matchCodes":["Ambiguous","Good"]},{"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1","bbox":[48.809565092429317,2.3172171827738461,48.81729052757067,2.3328581572261538],"name":"10 Avenue Léon Gambetta, 92120 Montrouge","point":{"type":"Point","coordinates":[48.813427809999993,2.32503767]},"address":{"addressLine":"10 Avenue Léon Gambetta","adminDistrict":"IdF","adminDistrict2":"Hauts-de-Seine","countryRegion":"France","formattedAddress":"10 Avenue Léon Gambetta, 92120 Montrouge","locality":"Montrouge","postalCode":"92120"},"confidence":"Medium","entityType":"Address","geocodePoints":[{"type":"Point","coordinates":[48.813427809999993,2.32503767],"calculationMethod":"Interpolation","usageTypes":["Display","Route"]}],"matchCodes":["Ambiguous","Good"]},{"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1","bbox":[48.806278752429328,2.4278605052896745,48.814004187570681,2.4435004547103261],"name":"10 Avenue Gambetta, 94700 Maisons-Alfort","point":{"type":"Point","coordinates":[48.810141470000005,2.4356804800000003]},"address":{"addressLine":"10 Avenue Gambetta","adminDistrict":"IdF","adminDistrict2":"Val-de-Marne","countryRegion":"France","formattedAddress":"10 Avenue Gambetta, 94700 Maisons-Alfort","locality":"Maisons-Alfort","postalCode":"94700"},"confidence":"Medium","entityType":"Address","geocodePoints":[{"type":"Point","coordinates":[48.810141470000005,2.4356804800000003],"calculationMethod":"Interpolation","usageTypes":["Display","Route"]}],"matchCodes":["Ambiguous","Good"]}]}],"statusCode":200,"statusDescription":"OK","traceId":"5af34e133a3d45a6b2f0382052ed8367|DB40051321|02.00.108.1000|DB4SCH010060660, DB4SCH010070350"}"; \ No newline at end of file diff --git a/tests/.cached_responses/10d59f96256e4f915a4e050350dcee48979fdd60 b/tests/.cached_responses/10d59f96256e4f915a4e050350dcee48979fdd60 deleted file mode 100644 index 799057125..000000000 --- a/tests/.cached_responses/10d59f96256e4f915a4e050350dcee48979fdd60 +++ /dev/null @@ -1,4 +0,0 @@ -s:303:" - -144.206.0.0 - 144.206.255.255RU 55.75578737.617634 -"; \ No newline at end of file diff --git a/tests/.cached_responses/125a55420bbd96e209e065acbb058d368c374199 b/tests/.cached_responses/125a55420bbd96e209e065acbb058d368c374199 deleted file mode 100644 index 29899ffe9..000000000 --- a/tests/.cached_responses/125a55420bbd96e209e065acbb058d368c374199 +++ /dev/null @@ -1 +0,0 @@ -s:2108:"{"found": 15, "bounds": [[44.96025, 2.54513], [50.29735, 5.99711]], "features": [{"id": 60352021,"centroid": {"type":"POINT","coordinates":[48.92846, 2.55019]},"bounds": [[48.92633, 2.54513], [48.93074, 2.55520]],"properties": {"osm_element": "way", "name": "Boulevard Robert Schuman", "highway": "unclassified", "osm_id": "29737437"},"location": {"county": "Ile-del-france", "country": "France", "city": "Montreuil"},"type": "Feature"},{"id": 60352017,"centroid": {"type":"POINT","coordinates":[49.64693, 5.99272]},"bounds": [[49.64676, 5.98893], [49.65023, 5.99711]],"properties": {"maxspeed": "30", "name": "Boulevard Robert Schuman", "addr:postcode": "L 8340", "osm_id": "25701555", "osm_element": "way", "highway": "residential"},"location": {"county": "Luxembourg", "country": "Luxembourg", "city": "Luxembourg"},"type": "Feature"},{"id": 60352015,"centroid": {"type":"POINT","coordinates":[44.96087, 4.90654]},"bounds": [[44.96025, 4.90413], [44.96109, 4.90946]],"properties": {"name": "Boulevard Robert Schuman", "highway": "tertiary", "osm_id": "55944983;23711307;23711306;23711305;23711303;23711302;23711301"},"location": {"county": "Rhone-alpes", "country": "France", "city": "Bourg lès Valence"},"type": "Feature"},{"id": 60352023,"centroid": {"type":"POINT","coordinates":[44.96098, 4.90574]},"bounds": [[44.96098, 4.90563], [44.96098, 4.90585]],"properties": {"osm_element": "way", "osm_id": "55944984", "name": "Boulevard Robert Schuman", "highway": "tertiary", "oneway": "yes"},"location": {"county": "Rhone-alpes", "country": "France", "city": "Bourg lès Valence"},"type": "Feature"},{"id": 60352022,"centroid": {"type":"POINT","coordinates":[50.29716, 2.77608]},"bounds": [[50.29633, 2.76961], [50.29735, 2.78268]],"properties": {"ref": "D 266", "name": "Boulevard Robert Schuman", "highway": "secondary", "osm_id": "38633787;38633785;38633783;38633781;34692368;34692294"},"location": {"county": "Nord-pas-de-calais", "country": "France", "city": "Arras"},"type": "Feature"}], "type": "FeatureCollection", "crs": {"type": "EPSG", "properties": {"code": 4326, "coordinate_order": [0, 1]}}}"; \ No newline at end of file diff --git a/tests/.cached_responses/1517375d8e82387124d1d0ed45d0d8157a2eab3c b/tests/.cached_responses/1517375d8e82387124d1d0ed45d0d8157a2eab3c deleted file mode 100644 index 2f3bbbf66..000000000 --- a/tests/.cached_responses/1517375d8e82387124d1d0ed45d0d8157a2eab3c +++ /dev/null @@ -1 +0,0 @@ -s:67:"{"spatialReference":{"wkid":4326,"latestWkid":4326},"locations":[]}"; \ No newline at end of file diff --git a/tests/.cached_responses/15fa9c272dd9ce0e678a0e3ceecfa4bb9e893a41 b/tests/.cached_responses/15fa9c272dd9ce0e678a0e3ceecfa4bb9e893a41 deleted file mode 100644 index a52a5c663..000000000 --- a/tests/.cached_responses/15fa9c272dd9ce0e678a0e3ceecfa4bb9e893a41 +++ /dev/null @@ -1 +0,0 @@ -s:3831:"48.8568982.350844u09tvqpu49ukTomTomMapcityParisIle-de-FranceFranceFRAParis, Ile-de-France, FRfalse111.00.053495456033.661426-95.5563219vup3xfh02dgTomTomMapcityParisTexasUnited StatesUSAParis, Texas, USfalse110.95454543828964230.051063843036.302754-88.326359dn3nw0dwyev4TomTomMapcityParisTennesseeUnited StatesUSAParis, Tennessee, USfalse110.95454543828964230.0510638430-19.03944829.560445kst58tvr0m9kTomTomMapcityParisMidlandsZimbabweZWEParis, Midlands, ZWfalse110.94318181276321410.050455943035.292105-93.7299229ym2g0ezqt0wTomTomMapcityParisArkansasUnited StatesUSAParis, Arkansas, USfalse110.94318181276321410.0504559430"; \ No newline at end of file diff --git a/tests/.cached_responses/1763277712d0dcbf4aa5aaa9b80366e272fc7fb1 b/tests/.cached_responses/1763277712d0dcbf4aa5aaa9b80366e272fc7fb1 deleted file mode 100644 index 9abc141c5..000000000 --- a/tests/.cached_responses/1763277712d0dcbf4aa5aaa9b80366e272fc7fb1 +++ /dev/null @@ -1,9 +0,0 @@ -s:266:" - - 38.8987483023256 - -77.0376837441861 - - -1600Pennsylvania AveWashingtonDC - -"; \ No newline at end of file diff --git a/tests/.cached_responses/49dcfe5f96e6289f277276a09fb3b26f353e2c8d b/tests/.cached_responses/1a602fb4b503dc7750b4ba1bbe0d7df8f3f2cc97 similarity index 95% rename from tests/.cached_responses/49dcfe5f96e6289f277276a09fb3b26f353e2c8d rename to tests/.cached_responses/1a602fb4b503dc7750b4ba1bbe0d7df8f3f2cc97 index 7c9042261..bbcbda5c8 100644 --- a/tests/.cached_responses/49dcfe5f96e6289f277276a09fb3b26f353e2c8d +++ b/tests/.cached_responses/1a602fb4b503dc7750b4ba1bbe0d7df8f3f2cc97 @@ -22,7 +22,7 @@ s:587:"{ "unit_test": { "api_calls": "100", "current_calls": "10", -"elapsed_time": "0.1178", +"elapsed_time": "0.0184", "memory_usage": "1.88MB" } } diff --git a/tests/.cached_responses/1c5bb23ad45167fa9d48bb8cb6a3dbda630d5bc4 b/tests/.cached_responses/1c5bb23ad45167fa9d48bb8cb6a3dbda630d5bc4 index fde7c231f..c1e703b99 100644 --- a/tests/.cached_responses/1c5bb23ad45167fa9d48bb8cb6a3dbda630d5bc4 +++ b/tests/.cached_responses/1c5bb23ad45167fa9d48bb8cb6a3dbda630d5bc4 @@ -1,4 +1,4 @@ -s:12784:"{ +s:12861:"{ "results" : [ { "address_components" : [ @@ -9,7 +9,7 @@ s:12784:"{ }, { "long_name" : "Avenue Gambetta", - "short_name" : "Av. Gambetta", + "short_name" : "Avenue Gambetta", "types" : [ "route" ] }, { @@ -66,9 +66,9 @@ s:12784:"{ "types" : [ "neighborhood", "political" ] }, { - "long_name" : "20e Arrondissement", - "short_name" : "20e Arrondissement", - "types" : [ "sublocality", "political" ] + "long_name" : "20th arrondissement", + "short_name" : "20th arrondissement", + "types" : [ "sublocality_level_1", "sublocality", "political" ] }, { "long_name" : "Paris", @@ -182,9 +182,9 @@ s:12784:"{ { "address_components" : [ { - "long_name" : "20e Arrondissement", - "short_name" : "20e Arrondissement", - "types" : [ "sublocality", "political" ] + "long_name" : "20th arrondissement", + "short_name" : "20th arrondissement", + "types" : [ "sublocality_level_1", "sublocality", "political" ] }, { "long_name" : "Paris", @@ -207,7 +207,7 @@ s:12784:"{ "types" : [ "country", "political" ] } ], - "formatted_address" : "20e Arrondissement, Paris, France", + "formatted_address" : "20th arrondissement, Paris, France", "geometry" : { "bounds" : { "northeast" : { @@ -235,7 +235,7 @@ s:12784:"{ } } }, - "types" : [ "sublocality", "political" ] + "types" : [ "sublocality_level_1", "sublocality", "political" ] }, { "address_components" : [ diff --git a/tests/.cached_responses/1c6d409ea3f33b963904640da05e4fa03acdaaee b/tests/.cached_responses/1c6d409ea3f33b963904640da05e4fa03acdaaee new file mode 100644 index 000000000..5525cccd7 --- /dev/null +++ b/tests/.cached_responses/1c6d409ea3f33b963904640da05e4fa03acdaaee @@ -0,0 +1 @@ +s:6165:"{"geonames":[{"distance":"0.00019","timezone":{"gmtOffset":0,"timeZoneId":"Europe/London","dstOffset":1},"countryId":"2635167","fcl":"P","adminId2":"2648110","countryCode":"GB","adminId1":"6269131","lat":"51.50853","fcode":"PPLC","continentCode":"EU","elevation":0,"adminCode2":"GLA","adminCode1":"ENG","lng":"-0.12574","geonameId":2643743,"toponymName":"London","population":7556900,"adminName5":"","adminName4":"","adminName3":"","alternateNames":[{"name":"Лондан","lang":"ab"},{"name":"Londen","lang":"af"},{"name":"London","lang":"als"},{"name":"ለንደን","lang":"am"},{"name":"Londres","lang":"an"},{"name":"Lunden","lang":"ang"},{"name":"لندن","lang":"ar"},{"name":"ܠܘܢܕܘܢ","lang":"arc"},{"name":"لندن","lang":"arz"},{"name":"Londres","lang":"ast"},{"name":"London","lang":"az"},{"name":"Лондон","lang":"ba"},{"name":"Londres","lang":"bcl"},{"name":"Горад Лондан","lang":"be"},{"name":"Лондон","lang":"bg"},{"name":"লন্ডন","lang":"bn"},{"name":"ལོན་ཊོན།","lang":"bo"},{"name":"Londrez","lang":"br"},{"name":"London","lang":"bs"},{"name":"Londres","lang":"ca"},{"name":"Lùng-dŭng","lang":"cdo"},{"name":"ᎫᎴ ᏗᏍᎪᏂᎯᏱ","lang":"chr"},{"name":"لەندەن","lang":"ckb"},{"name":"Londra","lang":"co"},{"name":"Londýn","lang":"cs"},{"name":"Лондонъ","lang":"cu"},{"name":"Лондон","lang":"cv"},{"name":"Llundain","lang":"cy"},{"name":"London","lang":"da"},{"name":"London","lang":"de"},{"name":"Londra","lang":"diq"},{"name":"Λονδίνο","lang":"el"},{"name":"London","lang":"en"},{"name":"Londono","lang":"eo"},{"name":"Londres","lang":"es"},{"name":"London","lang":"et"},{"name":"London","lang":"eu"},{"name":"Londri","lang":"ext"},{"name":"لندن","lang":"fa"},{"name":"Lontoo","lang":"fi"},{"name":"Londres","lang":"fr"},{"name":"Londres","lang":"frp"},{"name":"Londen","lang":"fy"},{"name":"Londain","lang":"ga"},{"name":"倫敦","lang":"gan"},{"name":"Lunnainn","lang":"gd"},{"name":"Londres","lang":"gl"},{"name":"Londye","lang":"gn"},{"name":"લંડન","lang":"gu"},{"name":"Lunnin","lang":"gv"},{"name":"Lākana","lang":"haw"},{"name":"London","lang":"hbs"},{"name":"לונדון","lang":"he"},{"name":"लंदन","lang":"hi"},{"name":"London","lang":"hr"},{"name":"Lonn","lang":"ht"},{"name":"London","lang":"hu"},{"name":"Լոնդոն","lang":"hy"},{"name":"London","lang":"ia"},{"name":"LON","lang":"iata"},{"name":"London","lang":"id"},{"name":"Londres","lang":"ilo"},{"name":"London","lang":"io"},{"name":"London","lang":"is"},{"name":"Londra","lang":"it"},{"name":"ロンドン","lang":"ja"},{"name":"london","lang":"jbo"},{"name":"ლონდონი","lang":"ka"},{"name":"Лондон","lang":"kk"},{"name":"ಲಂಡನ್","lang":"kn"},{"name":"런던","lang":"ko"},{"name":"Лондон","lang":"koi"},{"name":"Лондон","lang":"krc"},{"name":"London","lang":"ku"},{"name":"Лондон","lang":"kv"},{"name":"Loundres","lang":"kw"},{"name":"Лондон","lang":"ky"},{"name":"Londinium","lang":"la"},{"name":"Londra","lang":"lad"},{"name":"London","lang":"lb"},{"name":"Лондон","lang":"lbe"},{"name":"Лондон","lang":"lez"},{"name":"Londe","lang":"li"},{"name":"Londra","lang":"lij"},{"name":"http://en.wikipedia.org/wiki/London","lang":"link"},{"name":"Lundra","lang":"lmo"},{"name":"Londoni","lang":"ln"},{"name":"ລອນດອນ","lang":"lo"},{"name":"Londonas","lang":"lt"},{"name":"Londona","lang":"lv"},{"name":"Лондон","lang":"mhr"},{"name":"Rānana","lang":"mi"},{"name":"Лондон","lang":"mk"},{"name":"ലണ്ടൻ","lang":"ml"},{"name":"Лондон","lang":"mn"},{"name":"लंडन","lang":"mr"},{"name":"Лондон","lang":"mrj"},{"name":"London","lang":"ms"},{"name":"Londra","lang":"mt"},{"name":"Londres","lang":"mwl"},{"name":"လန်ဒန်မြို့","lang":"my"},{"name":"لندن","lang":"mzn"},{"name":"Londres","lang":"nah"},{"name":"Londra","lang":"nap"},{"name":"London","lang":"nds"},{"name":"लण्डन","lang":"ne"},{"name":"लण्डन","lang":"new"},{"name":"Londen","lang":"nl"},{"name":"London","lang":"nn"},{"name":"London","lang":"no"},{"name":"Londres","lang":"nrm"},{"name":"Londres","lang":"oc"},{"name":"ଲଣ୍ଡନ","lang":"or"},{"name":"Лондон","lang":"os"},{"name":"Londe","lang":"pcd"},{"name":"Londyn","lang":"pl"},{"name":"Londra","lang":"pms"},{"name":"لندن","lang":"pnb"},{"name":"Λονδίνο","lang":"pnt"},{"name":"لندن","lang":"ps"},{"name":"Londres","lang":"pt"},{"name":"London","lang":"qu"},{"name":"Londra","lang":"rm"},{"name":"Londra","lang":"ro"},{"name":"Лондон","lang":"ru"},{"name":"Лондон","lang":"rue"},{"name":"लन्डन्","lang":"sa"},{"name":"Лондон","lang":"sah"},{"name":"Londra","lang":"sc"},{"name":"Londra","lang":"scn"},{"name":"Lunnon","lang":"sco"},{"name":"ලන්ඩන්","lang":"si"},{"name":"Londýn","lang":"sk"},{"name":"London","lang":"sl"},{"name":"Londra","lang":"sq"},{"name":"Лондон","lang":"sr"},{"name":"London","lang":"sv"},{"name":"Lůndůn","lang":"szl"},{"name":"இலண்டன்","lang":"ta"},{"name":"లండన్","lang":"te"},{"name":"Londres","lang":"tet"},{"name":"Лондон","lang":"tg"},{"name":"ลอนดอน","lang":"th"},{"name":"Londres","lang":"tl"},{"name":"Landen","lang":"tpi"},{"name":"Londra","lang":"tr"},{"name":"Лондон","lang":"tt"},{"name":"Лондон","lang":"udm"},{"name":"لوندون","lang":"ug"},{"name":"Лондон","lang":"uk"},{"name":"لندن","lang":"ur"},{"name":"Łondra","lang":"vec"},{"name":"Luân Đôn","lang":"vi"},{"name":"Londn","lang":"vls"},{"name":"London","lang":"vo"},{"name":"Londar","lang":"wo"},{"name":"伦敦","lang":"wuu"},{"name":"ლონდონი","lang":"xmf"},{"name":"לאנדאן","lang":"yi"},{"name":"Lọndọnu","lang":"yo"},{"name":"Londen","lang":"zea"},{"name":"伦敦","lang":"zh"},{"name":"伦敦","lang":"zh-CN"},{"name":"ILondon","lang":"zu"}],"adminName2":"Greater London","name":"London","fclName":"city, village,...","countryName":"United Kingdom","fcodeName":"capital of a political entity","adminName1":"England"}]}"; \ No newline at end of file diff --git a/tests/.cached_responses/1ec836744699c92949abd980774e110560bc27b3 b/tests/.cached_responses/1ec836744699c92949abd980774e110560bc27b3 index 44948a7a1..b390a3bc4 100644 --- a/tests/.cached_responses/1ec836744699c92949abd980774e110560bc27b3 +++ b/tests/.cached_responses/1ec836744699c92949abd980774e110560bc27b3 @@ -1 +1,2 @@ -s:224:"{"ip":"132.185.255.60","country_code":"GB","country_name":"United Kingdom","region_code":"H9","region_name":"London, City of","city":"London","zipcode":"","latitude":51.5142,"longitude":-0.0931,"metro_code":"","areacode":""}"; \ No newline at end of file +s:211:"{"ip":"132.185.255.60","country_code":"GB","country_name":"United Kingdom","region_code":"","region_name":"","city":"","zip_code":"","time_zone":"Europe/London","latitude":51.5,"longitude":-0.13,"metro_code":0} +"; \ No newline at end of file diff --git a/tests/.cached_responses/2070f9c076c77cfc765be660b209d47ee9846762 b/tests/.cached_responses/2070f9c076c77cfc765be660b209d47ee9846762 deleted file mode 100644 index d0ceeb87e..000000000 --- a/tests/.cached_responses/2070f9c076c77cfc765be660b209d47ee9846762 +++ /dev/null @@ -1,11 +0,0 @@ -s:296:" - - - 009 - The latitude and longitude you provided are not in the valid range. - - 1 - -2 - - -"; \ No newline at end of file diff --git a/tests/.cached_responses/b0b4edb754ec522d7b4ba93b159fa9b68e628393 b/tests/.cached_responses/2215bf948357a4049640a7e6cce1eca1b6bace39 similarity index 85% rename from tests/.cached_responses/b0b4edb754ec522d7b4ba93b159fa9b68e628393 rename to tests/.cached_responses/2215bf948357a4049640a7e6cce1eca1b6bace39 index 8ef0effd4..04ab534d6 100644 --- a/tests/.cached_responses/b0b4edb754ec522d7b4ba93b159fa9b68e628393 +++ b/tests/.cached_responses/2215bf948357a4049640a7e6cce1eca1b6bace39 @@ -1 +1 @@ -s:215:"BR,Brazil,26,"Santa Catarina",Florianpolis,-27.5833,-48.5667,,,America/Sao_Paulo,SA,,"Global Village Telecom","Global Village Telecom",gvt.net.br,"AS18881 Global Village Telecom",Cable/DSL,residential,18,99,52,92,,"; \ No newline at end of file +s:215:"BR,Brazil,26,"Santa Catarina",Florianpolis,-27.5833,-48.5667,,,America/Sao_Paulo,SA,,"Global Village Telecom","Global Village Telecom",gvt.net.br,"AS18881 Global Village Telecom",Cable/DSL,residential,26,99,46,93,,"; \ No newline at end of file diff --git a/tests/.cached_responses/238d73130d78d936d4e861b87cce62e9e3dbb585 b/tests/.cached_responses/238d73130d78d936d4e861b87cce62e9e3dbb585 deleted file mode 100644 index ba9c3e93e..000000000 --- a/tests/.cached_responses/238d73130d78d936d4e861b87cce62e9e3dbb585 +++ /dev/null @@ -1 +0,0 @@ -s:1992:"55.70438912.546129u3buvkxv9fxzTomTomMap422poi7311Uno-X0Uno-X0180.0TagensvejCopenhagueDanemarkDNK2200Uno-X, Tagensvej 422, 2200, Copenhague, DNKfalse111.01.00"; \ No newline at end of file diff --git a/tests/.cached_responses/2574881cbb127d2489bfa79c4e7ac99356045946 b/tests/.cached_responses/2574881cbb127d2489bfa79c4e7ac99356045946 index 2cf1b4ba9..470731b8c 100644 --- a/tests/.cached_responses/2574881cbb127d2489bfa79c4e7ac99356045946 +++ b/tests/.cached_responses/2574881cbb127d2489bfa79c4e7ac99356045946 @@ -1,4 +1,4 @@ -s:2146:"{ +s:1854:"{ "results" : [ { "address_components" : [ @@ -9,7 +9,7 @@ s:2146:"{ }, { "long_name" : "Avenue Gambetta", - "short_name" : "Av. Gambetta", + "short_name" : "Avenue Gambetta", "types" : [ "route" ] }, { @@ -40,29 +40,19 @@ s:2146:"{ ], "formatted_address" : "10 Avenue Gambetta, 75020 Paris, France", "geometry" : { - "bounds" : { - "northeast" : { - "lat" : 48.8630494, - "lng" : 2.3882478 - }, - "southwest" : { - "lat" : 48.863038, - "lng" : 2.3882414 - } - }, "location" : { - "lat" : 48.863038, - "lng" : 2.3882478 + "lat" : 48.8631013, + "lng" : 2.3888086 }, - "location_type" : "RANGE_INTERPOLATED", + "location_type" : "ROOFTOP", "viewport" : { "northeast" : { - "lat" : 48.86439268029149, - "lng" : 2.389593580291502 + "lat" : 48.8644502802915, + "lng" : 2.390157580291502 }, "southwest" : { - "lat" : 48.8616947197085, - "lng" : 2.386895619708498 + "lat" : 48.8617523197085, + "lng" : 2.387459619708498 } } }, diff --git a/tests/.cached_responses/25f2875e5d5e2604c081724fe933ddd626cb95c1 b/tests/.cached_responses/25f2875e5d5e2604c081724fe933ddd626cb95c1 deleted file mode 100644 index 43542cf79..000000000 --- a/tests/.cached_responses/25f2875e5d5e2604c081724fe933ddd626cb95c1 +++ /dev/null @@ -1 +0,0 @@ -s:1877:"55.70438912.546129u3buvkxv9fxzTomTomMappoi7311UNO-X København N0Uno-X2180.0TagensvejCopenhagenDenmarkDNK2200UNO-X København N, Tagensvej, 2200, Copenhagen, DNKfalse111.01.00"; \ No newline at end of file diff --git a/tests/.cached_responses/f00adac5ecd9df04488077c3b48b382a3aa6bf9f b/tests/.cached_responses/2b4f3a47fa3f17ffd4b8ebd05d1beeb991f7b77a similarity index 89% rename from tests/.cached_responses/f00adac5ecd9df04488077c3b48b382a3aa6bf9f rename to tests/.cached_responses/2b4f3a47fa3f17ffd4b8ebd05d1beeb991f7b77a index 6af780f8d..1c5df80d6 100644 --- a/tests/.cached_responses/f00adac5ecd9df04488077c3b48b382a3aa6bf9f +++ b/tests/.cached_responses/2b4f3a47fa3f17ffd4b8ebd05d1beeb991f7b77a @@ -7,7 +7,7 @@ s:244:"{ "unit_test": { "api_calls": "100", "current_calls": "11", -"elapsed_time": "0.0222", +"elapsed_time": "0.0180", "memory_usage": "1.88MB" } } diff --git a/tests/.cached_responses/2b7917a77f7f2c7a527c31c405ef28f5a5268414 b/tests/.cached_responses/2b7917a77f7f2c7a527c31c405ef28f5a5268414 deleted file mode 100644 index b29f3a92a..000000000 --- a/tests/.cached_responses/2b7917a77f7f2c7a527c31c405ef28f5a5268414 +++ /dev/null @@ -1 +0,0 @@ -s:957:"{"results":[{"locations":[{"latLng":{"lng":-2.799034,"lat":54.048407},"adminArea4":"Lancashire","adminArea5Type":"City","adminArea4Type":"County","adminArea5":"Lancaster","street":"Mary Street","adminArea1":"GB","adminArea3":"England","type":"s","displayLatLng":{"lng":-2.799274,"lat":54.047668},"linkId":0,"postalCode":"LA1 1LZ","sideOfStreet":"N","dragPoint":false,"adminArea1Type":"Country","geocodeQuality":"ADDRESS","geocodeQualityCode":"L1AAA","mapUrl":"http://open.mapquestapi.com/staticmap/v4/getmap?type=map&size=225,160&pois=purple-1,54.048407,-2.799034,0,0|¢er=54.048407,-2.799034&zoom=15&rand=-69045905","adminArea3Type":"State"}],"providedLocation":{"latLng":{"lng":-2.799034,"lat":54.048407}}}],"options":{"ignoreLatLngInput":false,"maxResults":-1,"thumbMaps":true},"info":{"copyright":{"text":"© 2013 MapQuest, Inc.","imageUrl":"http://api.mqcdn.com/res/mqlogo.gif","imageAltText":"© 2013 MapQuest, Inc."},"statuscode":0,"messages":[]}}"; \ No newline at end of file diff --git a/tests/.cached_responses/2c024cb7bd51af442a29294a4f9d753dce871a36 b/tests/.cached_responses/2c024cb7bd51af442a29294a4f9d753dce871a36 deleted file mode 100644 index 5df8d23cc..000000000 --- a/tests/.cached_responses/2c024cb7bd51af442a29294a4f9d753dce871a36 +++ /dev/null @@ -1,11 +0,0 @@ -s:259:" - - - 005 - Postal Code is not in the proper Format. - - - - - - -"; \ No newline at end of file diff --git a/tests/.cached_responses/2f3ed3ae641669ffaca8bf883feb1705e8492e6c b/tests/.cached_responses/2f3ed3ae641669ffaca8bf883feb1705e8492e6c deleted file mode 100644 index 114de59c1..000000000 --- a/tests/.cached_responses/2f3ed3ae641669ffaca8bf883feb1705e8492e6c +++ /dev/null @@ -1 +0,0 @@ -s:604:"48.863232.38877Avenue Gambetta20e Arrondissement ParisFranceFRAAvenue Gambetta 23, 20e Arrondissement Paris, FRS48.864772.3985923"; \ No newline at end of file diff --git a/tests/.cached_responses/2f8e7075736ee6b9e1b9ad0e630889a2cbc518a2 b/tests/.cached_responses/2f8e7075736ee6b9e1b9ad0e630889a2cbc518a2 deleted file mode 100644 index 2f3bbbf66..000000000 --- a/tests/.cached_responses/2f8e7075736ee6b9e1b9ad0e630889a2cbc518a2 +++ /dev/null @@ -1 +0,0 @@ -s:67:"{"spatialReference":{"wkid":4326,"latestWkid":4326},"locations":[]}"; \ No newline at end of file diff --git a/tests/.cached_responses/3117e4255511124c8c1a097f85f1cad5ae01437f b/tests/.cached_responses/3117e4255511124c8c1a097f85f1cad5ae01437f index 44948a7a1..b390a3bc4 100644 --- a/tests/.cached_responses/3117e4255511124c8c1a097f85f1cad5ae01437f +++ b/tests/.cached_responses/3117e4255511124c8c1a097f85f1cad5ae01437f @@ -1 +1,2 @@ -s:224:"{"ip":"132.185.255.60","country_code":"GB","country_name":"United Kingdom","region_code":"H9","region_name":"London, City of","city":"London","zipcode":"","latitude":51.5142,"longitude":-0.0931,"metro_code":"","areacode":""}"; \ No newline at end of file +s:211:"{"ip":"132.185.255.60","country_code":"GB","country_name":"United Kingdom","region_code":"","region_name":"","city":"","zip_code":"","time_zone":"Europe/London","latitude":51.5,"longitude":-0.13,"metro_code":0} +"; \ No newline at end of file diff --git a/tests/.cached_responses/4f5cc7e59037868ffefe62f12e367592fdd3eafe b/tests/.cached_responses/32ae7d88654feada04b47acc206701b989f062a0 similarity index 100% rename from tests/.cached_responses/4f5cc7e59037868ffefe62f12e367592fdd3eafe rename to tests/.cached_responses/32ae7d88654feada04b47acc206701b989f062a0 diff --git a/tests/.cached_responses/334d6dcd0369e1f7e7291ce6a01d2aa4e8a3b3ee b/tests/.cached_responses/334d6dcd0369e1f7e7291ce6a01d2aa4e8a3b3ee deleted file mode 100644 index 79708f958..000000000 --- a/tests/.cached_responses/334d6dcd0369e1f7e7291ce6a01d2aa4e8a3b3ee +++ /dev/null @@ -1 +0,0 @@ -s:789:"{"results":[{"locations":[{"latLng":{"lng":2.389089,"lat":48.863193},"adminArea4":"Paris","adminArea5Type":"City","adminArea4Type":"County","adminArea5":"Paris","street":"10 Avenue Gambetta","adminArea1":"FR","adminArea3":"Ile-de-France","type":"s","displayLatLng":{"lng":2.389089,"lat":48.863193},"linkId":0,"postalCode":"75011","sideOfStreet":"N","dragPoint":false,"adminArea1Type":"Country","geocodeQuality":"POINT","geocodeQualityCode":"P1CXX","adminArea3Type":"State"}],"providedLocation":{"location":"10 avenue Gambetta, Paris, France"}}],"options":{"ignoreLatLngInput":false,"maxResults":5,"thumbMaps":false},"info":{"copyright":{"text":"© 2013 MapQuest, Inc.","imageUrl":"http://api.mqcdn.com/res/mqlogo.gif","imageAltText":"© 2013 MapQuest, Inc."},"statuscode":0,"messages":[]}}"; \ No newline at end of file diff --git a/tests/.cached_responses/3995c1e685bc49f4ff18bdb4f9c54f82adffc511 b/tests/.cached_responses/3995c1e685bc49f4ff18bdb4f9c54f82adffc511 deleted file mode 100644 index e1d8d2509..000000000 --- a/tests/.cached_responses/3995c1e685bc49f4ff18bdb4f9c54f82adffc511 +++ /dev/null @@ -1 +0,0 @@ -s:6184:"{"geonames":[{"adminCode2":"GLA","alternateNames":[{"name":"Лондан","lang":"ab"},{"name":"Londen","lang":"af"},{"name":"London","lang":"als"},{"name":"ለንደን","lang":"am"},{"name":"Londres","lang":"an"},{"name":"Lunden","lang":"ang"},{"name":"لندن","lang":"ar"},{"name":"ܠܘܢܕܘܢ","lang":"arc"},{"name":"لندن","lang":"arz"},{"name":"Londres","lang":"ast"},{"name":"London","lang":"az"},{"name":"Лондон","lang":"ba"},{"name":"Londres","lang":"bcl"},{"name":"Горад Лондан","lang":"be"},{"name":"Лондон","lang":"bg"},{"name":"লন্ডন","lang":"bn"},{"name":"ལོན་ཊོན།","lang":"bo"},{"name":"Londrez","lang":"br"},{"name":"London","lang":"bs"},{"name":"Londres","lang":"ca"},{"name":"Lùng-dŭng","lang":"cdo"},{"name":"ᎫᎴ ᏗᏍᎪᏂᎯᏱ","lang":"chr"},{"name":"لەندەن","lang":"ckb"},{"name":"Londra","lang":"co"},{"name":"Londýn","lang":"cs"},{"name":"Лондонъ","lang":"cu"},{"name":"Лондон","lang":"cv"},{"name":"Llundain","lang":"cy"},{"name":"London","lang":"da"},{"name":"London","lang":"de"},{"name":"Londra","lang":"diq"},{"name":"Λονδίνο","lang":"el"},{"name":"London","lang":"en"},{"name":"Londono","lang":"eo"},{"name":"Londres","lang":"es"},{"name":"London","lang":"et"},{"name":"London","lang":"eu"},{"name":"Londri","lang":"ext"},{"name":"لندن","lang":"fa"},{"name":"Lontoo","lang":"fi"},{"name":"Londres","lang":"fr"},{"name":"Londres","lang":"frp"},{"name":"Londen","lang":"fy"},{"name":"Londain","lang":"ga"},{"name":"倫敦","lang":"gan"},{"name":"Lunnainn","lang":"gd"},{"name":"Londres","lang":"gl"},{"name":"Londye","lang":"gn"},{"name":"લંડન","lang":"gu"},{"name":"Lunnin","lang":"gv"},{"name":"Lākana","lang":"haw"},{"name":"London","lang":"hbs"},{"name":"לונדון","lang":"he"},{"name":"लंदन","lang":"hi"},{"name":"London","lang":"hr"},{"name":"Lonn","lang":"ht"},{"name":"London","lang":"hu"},{"name":"Լոնդոն","lang":"hy"},{"name":"London","lang":"ia"},{"name":"LON","lang":"iata"},{"name":"London","lang":"id"},{"name":"Londres","lang":"ilo"},{"name":"London","lang":"io"},{"name":"London","lang":"is"},{"name":"Londra","lang":"it"},{"name":"ロンドン","lang":"ja"},{"name":"london","lang":"jbo"},{"name":"ლონდონი","lang":"ka"},{"name":"Лондон","lang":"kk"},{"name":"ಲಂಡನ್","lang":"kn"},{"name":"런던","lang":"ko"},{"name":"Лондон","lang":"koi"},{"name":"Лондон","lang":"krc"},{"name":"London","lang":"ku"},{"name":"Лондон","lang":"kv"},{"name":"Loundres","lang":"kw"},{"name":"Лондон","lang":"ky"},{"name":"Londinium","lang":"la"},{"name":"Londra","lang":"lad"},{"name":"London","lang":"lb"},{"name":"Лондон","lang":"lbe"},{"name":"Лондон","lang":"lez"},{"name":"Londe","lang":"li"},{"name":"Londra","lang":"lij"},{"name":"http://en.wikipedia.org/wiki/London","lang":"link"},{"name":"Lundra","lang":"lmo"},{"name":"Londoni","lang":"ln"},{"name":"ລອນດອນ","lang":"lo"},{"name":"Londonas","lang":"lt"},{"name":"Londona","lang":"lv"},{"name":"Лондон","lang":"mhr"},{"name":"Rānana","lang":"mi"},{"name":"Лондон","lang":"mk"},{"name":"ലണ്ടൻ","lang":"ml"},{"name":"Лондон","lang":"mn"},{"name":"लंडन","lang":"mr"},{"name":"Лондон","lang":"mrj"},{"name":"London","lang":"ms"},{"name":"Londra","lang":"mt"},{"name":"Londres","lang":"mwl"},{"name":"လန်ဒန်မြို့","lang":"my"},{"name":"لندن","lang":"mzn"},{"name":"Londres","lang":"nah"},{"name":"Londra","lang":"nap"},{"name":"London","lang":"nds"},{"name":"लण्डन","lang":"ne"},{"name":"लण्डन","lang":"new"},{"name":"Londen","lang":"nl"},{"name":"London","lang":"nn"},{"name":"London","lang":"no"},{"name":"Londres","lang":"nrm"},{"name":"Londres","lang":"oc"},{"name":"ଲଣ୍ଡନ","lang":"or"},{"name":"Лондон","lang":"os"},{"name":"Londe","lang":"pcd"},{"name":"Londyn","lang":"pl"},{"name":"Londra","lang":"pms"},{"name":"لندن","lang":"pnb"},{"name":"Λονδίνο","lang":"pnt"},{"name":"لندن","lang":"ps"},{"name":"Londres","lang":"pt"},{"name":"London","lang":"qu"},{"name":"Londra","lang":"rm"},{"name":"Londra","lang":"ro"},{"name":"Лондон","lang":"ru"},{"name":"Лондон","lang":"rue"},{"name":"लन्डन्","lang":"sa"},{"name":"Лондон","lang":"sah"},{"name":"Londra","lang":"sc"},{"name":"Londra","lang":"scn"},{"name":"Lunnon","lang":"sco"},{"name":"ලන්ඩන්","lang":"si"},{"name":"Londýn","lang":"sk"},{"name":"London","lang":"sl"},{"name":"Londra","lang":"sq"},{"name":"Лондон","lang":"sr"},{"name":"London","lang":"sv"},{"name":"Lůndůn","lang":"szl"},{"name":"இலண்டன்","lang":"ta"},{"name":"లండన్","lang":"te"},{"name":"Londres","lang":"tet"},{"name":"Лондон","lang":"tg"},{"name":"ลอนดอน","lang":"th"},{"name":"Londres","lang":"tl"},{"name":"Landen","lang":"tpi"},{"name":"Londra","lang":"tr"},{"name":"Лондон","lang":"tt"},{"name":"Лондон","lang":"udm"},{"name":"لوندون","lang":"ug"},{"name":"Лондон","lang":"uk"},{"name":"لندن","lang":"ur"},{"name":"Łondra","lang":"vec"},{"name":"Luân Đôn","lang":"vi"},{"name":"Londn","lang":"vls"},{"name":"London","lang":"vo"},{"name":"Londar","lang":"wo"},{"name":"伦敦","lang":"wuu"},{"name":"ლონდონი","lang":"xmf"},{"name":"לאנדאן","lang":"yi"},{"name":"Lọndọnu","lang":"yo"},{"name":"Londen","lang":"zea"},{"name":"伦敦","lang":"zh"},{"name":"伦敦","lang":"zh-CN"},{"name":"ILondon","lang":"zu"}],"countryName":"Regno Unito","adminCode1":"ENG","lng":"-0.12574","adminName2":"Greater London","fcodeName":"capital of a political entity","adminName3":"","distance":"0.00019","timezone":{"dstOffset":1,"gmtOffset":0,"timeZoneId":"Europe/London"},"adminName4":"","adminName5":"","name":"Londra","fcode":"PPLC","geonameId":2643743,"lat":"51.50853","population":7556900,"adminName1":"Inghilterra","adminId1":"6269131","countryId":"2635167","fclName":"city, village,...","elevation":0,"countryCode":"GB","adminId2":"2648110","wikipediaURL":"","toponymName":"London","fcl":"P","continentCode":"EU"}]}"; \ No newline at end of file diff --git a/tests/.cached_responses/3b3fbaa39a76b6bd256d617f4a570ddb7bbe8091 b/tests/.cached_responses/3b3fbaa39a76b6bd256d617f4a570ddb7bbe8091 deleted file mode 100644 index 80487e7fb..000000000 --- a/tests/.cached_responses/3b3fbaa39a76b6bd256d617f4a570ddb7bbe8091 +++ /dev/null @@ -1,11 +0,0 @@ -s:263:" - - - 003 - Authentication token: bad-api-key not found. - - - - - - -"; \ No newline at end of file diff --git a/tests/.cached_responses/288c9c8fffb736b97f92c54e551d79637d3d99f8 b/tests/.cached_responses/3be7f42ac361de5b9bd9baa64a1e21d3fabbe109 similarity index 78% rename from tests/.cached_responses/288c9c8fffb736b97f92c54e551d79637d3d99f8 rename to tests/.cached_responses/3be7f42ac361de5b9bd9baa64a1e21d3fabbe109 index 177bb0812..cb32082df 100644 --- a/tests/.cached_responses/288c9c8fffb736b97f92c54e551d79637d3d99f8 +++ b/tests/.cached_responses/3be7f42ac361de5b9bd9baa64a1e21d3fabbe109 @@ -1,4 +1,4 @@ -s:2745:"{ +s:2992:"{ "licenses" : [ { "name" : "CC-BY-SA", @@ -11,14 +11,22 @@ s:2745:"{ ], "rate" : { "limit" : 2500, - "remaining" : 2493, - "reset" : 1418601600 + "remaining" : 2478, + "reset" : 1422835200 }, "results" : [ { "annotations" : { + "DMS" : { + "lat" : "54\u00b0 2' 55.96656'' N", + "lng" : "2\u00b0 47' 56.21674'' W" + }, "MGRS" : "30UWE1316388978", "Maidenhead" : "IO84ob41dr", + "Mercator" : { + "x" : -311577.588, + "y" : 7144803.727 + }, "OSGB" : { "easting" : 347696.195, "gridref" : "SD 476 617", @@ -31,14 +39,14 @@ s:2745:"{ "geohash" : "gcw52r3cec2m35vkre86", "sun" : { "rise" : { - "astronomical" : 1418537280, - "civil" : 1418542680, - "nautical" : 1418539920 + "astronomical" : 1422769980, + "civil" : 1422775020, + "nautical" : 1422772500 }, "set" : { - "astronomical" : 1418580240, - "civil" : 1418574840, - "nautical" : 1418577600 + "astronomical" : 1422817020, + "civil" : 1422811980, + "nautical" : 1422814560 } }, "timezone" : { @@ -87,8 +95,8 @@ s:2745:"{ }, "thanks" : "For using an OpenCage Data API", "timestamp" : { - "created_http" : "Sun, 14 Dec 2014 18:40:40 GMT", - "created_unix" : 1418582440 + "created_http" : "Sun, 01 Feb 2015 16:13:40 GMT", + "created_unix" : 1422807220 }, "total_results" : 1, "we_are_hiring" : "http://lokku.com/#jobs" diff --git a/tests/.cached_responses/5d81702425bd32b235bca9e95467c97fb9e8f9e7 b/tests/.cached_responses/3e262b0d16f709138ab5c27e5ae7009df27e692b similarity index 93% rename from tests/.cached_responses/5d81702425bd32b235bca9e95467c97fb9e8f9e7 rename to tests/.cached_responses/3e262b0d16f709138ab5c27e5ae7009df27e692b index 8d74c3a6a..8512c4d57 100644 --- a/tests/.cached_responses/5d81702425bd32b235bca9e95467c97fb9e8f9e7 +++ b/tests/.cached_responses/3e262b0d16f709138ab5c27e5ae7009df27e692b @@ -1 +1 @@ -s:1991:"55.70438912.546129u3buvkxv9fxzTomTomMap422poi7311Uno-X0Uno-X0180.0TagensvejKöpenhamnDanmarkDNK2200Uno-X, Tagensvej 422, 2200, Köpenhamn, DNKfalse111.01.00"; \ No newline at end of file +s:1991:"55.70438912.546129u3buvkxv9fxzTomTomMap422poi7311Uno-X0Uno-X0180.0TagensvejKöpenhamnDanmarkDNK2200Uno-X, Tagensvej 422, 2200, Köpenhamn, DNKfalse111.01.00"; \ No newline at end of file diff --git a/tests/.cached_responses/3e5946648cee4777431d757281bad6d023a22b3f b/tests/.cached_responses/3e5946648cee4777431d757281bad6d023a22b3f deleted file mode 100644 index 5df8d23cc..000000000 --- a/tests/.cached_responses/3e5946648cee4777431d757281bad6d023a22b3f +++ /dev/null @@ -1,11 +0,0 @@ -s:259:" - - - 005 - Postal Code is not in the proper Format. - - - - - - -"; \ No newline at end of file diff --git a/tests/.cached_responses/40a56f7770fc2a796eb01fc984f89a46eaeb3ad0 b/tests/.cached_responses/40a56f7770fc2a796eb01fc984f89a46eaeb3ad0 index 2cf1b4ba9..470731b8c 100644 --- a/tests/.cached_responses/40a56f7770fc2a796eb01fc984f89a46eaeb3ad0 +++ b/tests/.cached_responses/40a56f7770fc2a796eb01fc984f89a46eaeb3ad0 @@ -1,4 +1,4 @@ -s:2146:"{ +s:1854:"{ "results" : [ { "address_components" : [ @@ -9,7 +9,7 @@ s:2146:"{ }, { "long_name" : "Avenue Gambetta", - "short_name" : "Av. Gambetta", + "short_name" : "Avenue Gambetta", "types" : [ "route" ] }, { @@ -40,29 +40,19 @@ s:2146:"{ ], "formatted_address" : "10 Avenue Gambetta, 75020 Paris, France", "geometry" : { - "bounds" : { - "northeast" : { - "lat" : 48.8630494, - "lng" : 2.3882478 - }, - "southwest" : { - "lat" : 48.863038, - "lng" : 2.3882414 - } - }, "location" : { - "lat" : 48.863038, - "lng" : 2.3882478 + "lat" : 48.8631013, + "lng" : 2.3888086 }, - "location_type" : "RANGE_INTERPOLATED", + "location_type" : "ROOFTOP", "viewport" : { "northeast" : { - "lat" : 48.86439268029149, - "lng" : 2.389593580291502 + "lat" : 48.8644502802915, + "lng" : 2.390157580291502 }, "southwest" : { - "lat" : 48.8616947197085, - "lng" : 2.386895619708498 + "lat" : 48.8617523197085, + "lng" : 2.387459619708498 } } }, diff --git a/tests/.cached_responses/f2c2aa8eb877d1ae29c3b1c3f8bcb895b73e19d1 b/tests/.cached_responses/415bd5046e65920c11f0b065db29d919cc956e46 similarity index 51% rename from tests/.cached_responses/f2c2aa8eb877d1ae29c3b1c3f8bcb895b73e19d1 rename to tests/.cached_responses/415bd5046e65920c11f0b065db29d919cc956e46 index 7632bdc67..90d334e2d 100644 --- a/tests/.cached_responses/f2c2aa8eb877d1ae29c3b1c3f8bcb895b73e19d1 +++ b/tests/.cached_responses/415bd5046e65920c11f0b065db29d919cc956e46 @@ -1 +1 @@ -s:993:"{"results":[{"locations":[{"latLng":{"lng":-2.799034,"lat":54.048407},"adminArea4":"Lancashire","adminArea5Type":"City","adminArea4Type":"County","adminArea5":"Lancaster","street":"Lancaster Gate","adminArea1":"GB","adminArea3":"England","type":"s","displayLatLng":{"lng":-2.798949,"lat":54.04888},"linkId":0,"postalCode":"LA1 1LZ","sideOfStreet":"N","dragPoint":false,"adminArea1Type":"Country","geocodeQuality":"ADDRESS","geocodeQualityCode":"L1AAA","mapUrl":"http://open.mapquestapi.com/staticmap/v4/getmap?key=Fmjtd|luubn1uz2q,a5=o5-90bs9a&type=map&size=225,160&pois=purple-1,54.048407,-2.799034,0,0|¢er=54.048407,-2.799034&zoom=15&rand=159391389","adminArea3Type":"State"}],"providedLocation":{"latLng":{"lng":-2.799034,"lat":54.048407}}}],"options":{"ignoreLatLngInput":false,"maxResults":-1,"thumbMaps":true},"info":{"copyright":{"text":"© 2014 MapQuest, Inc.","imageUrl":"http://api.mqcdn.com/res/mqlogo.gif","imageAltText":"© 2014 MapQuest, Inc."},"statuscode":0,"messages":[]}}"; \ No newline at end of file +s:994:"{"results":[{"locations":[{"latLng":{"lng":-2.799034,"lat":54.048407},"adminArea4":"Lancashire","adminArea5Type":"City","adminArea4Type":"County","adminArea5":"Lancaster","street":"Lancaster Gate","adminArea1":"GB","adminArea3":"England","type":"s","displayLatLng":{"lng":-2.798949,"lat":54.04888},"linkId":0,"postalCode":"LA1 1LZ","sideOfStreet":"N","dragPoint":false,"adminArea1Type":"Country","geocodeQuality":"ADDRESS","geocodeQualityCode":"L1AAA","mapUrl":"http://open.mapquestapi.com/staticmap/v4/getmap?key=Fmjtd|luu82908n1,85=o5-947550&type=map&size=225,160&pois=purple-1,54.048407,-2.799034,0,0|¢er=54.048407,-2.799034&zoom=15&rand=-205090343","adminArea3Type":"State"}],"providedLocation":{"latLng":{"lng":-2.799034,"lat":54.048407}}}],"options":{"ignoreLatLngInput":false,"maxResults":-1,"thumbMaps":true},"info":{"copyright":{"text":"© 2014 MapQuest, Inc.","imageUrl":"http://api.mqcdn.com/res/mqlogo.gif","imageAltText":"© 2014 MapQuest, Inc."},"statuscode":0,"messages":[]}}"; \ No newline at end of file diff --git a/tests/.cached_responses/44b73d9a4f187d8a30b1583fef046508069c4feb b/tests/.cached_responses/44b73d9a4f187d8a30b1583fef046508069c4feb deleted file mode 100644 index 9abc141c5..000000000 --- a/tests/.cached_responses/44b73d9a4f187d8a30b1583fef046508069c4feb +++ /dev/null @@ -1,9 +0,0 @@ -s:266:" - - 38.8987483023256 - -77.0376837441861 - - -1600Pennsylvania AveWashingtonDC - -"; \ No newline at end of file diff --git a/tests/.cached_responses/49b4c4c3f4eddcff2761213b050ef33cc8c50db3 b/tests/.cached_responses/49b4c4c3f4eddcff2761213b050ef33cc8c50db3 deleted file mode 100644 index 5ad29e317..000000000 --- a/tests/.cached_responses/49b4c4c3f4eddcff2761213b050ef33cc8c50db3 +++ /dev/null @@ -1,69 +0,0 @@ -s:2067:"{ - "results" : [ - { - "address_components" : [ - { - "long_name" : "10", - "short_name" : "10", - "types" : [ "street_number" ] - }, - { - "long_name" : "Kalbacher Hauptstraße", - "short_name" : "Kalbacher Hauptstraße", - "types" : [ "route" ] - }, - { - "long_name" : "Kalbach-Riedberg", - "short_name" : "Kalbach-Riedberg", - "types" : [ "sublocality", "political" ] - }, - { - "long_name" : "Frankfurt", - "short_name" : "Frankfurt", - "types" : [ "locality", "political" ] - }, - { - "long_name" : "Darmstadt", - "short_name" : "DA", - "types" : [ "administrative_area_level_2", "political" ] - }, - { - "long_name" : "Hesse", - "short_name" : "HE", - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "long_name" : "Germany", - "short_name" : "DE", - "types" : [ "country", "political" ] - }, - { - "long_name" : "60437", - "short_name" : "60437", - "types" : [ "postal_code" ] - } - ], - "formatted_address" : "Kalbacher Hauptstraße 10, 60437 Frankfurt, Germany", - "geometry" : { - "location" : { - "lat" : 50.1889896, - "lng" : 8.6366675 - }, - "location_type" : "ROOFTOP", - "viewport" : { - "northeast" : { - "lat" : 50.1903385802915, - "lng" : 8.638016480291503 - }, - "southwest" : { - "lat" : 50.1876406197085, - "lng" : 8.635318519708498 - } - } - }, - "types" : [ "street_address" ] - } - ], - "status" : "OK" -} -"; \ No newline at end of file diff --git a/tests/.cached_responses/e784f2f96e2a26b406daa8fe4fe12e814eb63f4e b/tests/.cached_responses/4b209c50e1a1572c76e2700fc70399d4f173a621 similarity index 96% rename from tests/.cached_responses/e784f2f96e2a26b406daa8fe4fe12e814eb63f4e rename to tests/.cached_responses/4b209c50e1a1572c76e2700fc70399d4f173a621 index d51ffe1dd..ed3e081d4 100644 --- a/tests/.cached_responses/e784f2f96e2a26b406daa8fe4fe12e814eb63f4e +++ b/tests/.cached_responses/4b209c50e1a1572c76e2700fc70399d4f173a621 @@ -1 +1 @@ -s:3935:"48.8568982.350844u09tvqpu49ukTomTomMapcityParisIle-de-FranceFranceFRAParis, Ile-de-France, FRfalse111.00.053527977033.661426-95.5563219vup3xfh02dgTomTomMapcityParisTexasUnited StatesUSAParis, Texas, USfalse110.95454537868499760.051094882036.302754-88.326359dn3nw0dwyev4TomTomMapcityParisTennesseeUnited StatesUSAParis, Tennessee, USfalse110.95454537868499760.0510948820-19.03944829.560445kst58tvr0m9kTomTomMapcityParisMidlandsZimbabweZWEParis, Midlands, ZWfalse110.94318175315856930.05048661035.292105-93.7299229ym2g0ezqt0wTomTomMapcityParisArkansasUnited StatesUSAParis, Arkansas, USfalse110.94318175315856930.050486610"; \ No newline at end of file +s:3935:"48.8568982.350844u09tvqpu49ukTomTomMapcityParisIle-de-FranceFranceFRAParis, Ile-de-France, FRfalse111.00.053527977033.661426-95.5563219vup3xfh02dgTomTomMapcityParisTexasUnited StatesUSAParis, Texas, USfalse110.95454537868499760.051094882036.302754-88.326359dn3nw0dwyev4TomTomMapcityParisTennesseeUnited StatesUSAParis, Tennessee, USfalse110.95454537868499760.0510948820-19.03944829.560445kst58tvr0m9kTomTomMapcityParisMidlandsZimbabweZWEParis, Midlands, ZWfalse110.94318175315856930.05048661035.292105-93.7299229ym2g0ezqt0wTomTomMapcityParisArkansasUnited StatesUSAParis, Arkansas, USfalse110.94318175315856930.050486610"; \ No newline at end of file diff --git a/tests/.cached_responses/4d379baf1d6bff9d4918f098c495a5d79ddabed6 b/tests/.cached_responses/4d379baf1d6bff9d4918f098c495a5d79ddabed6 new file mode 100644 index 000000000..2b0764048 --- /dev/null +++ b/tests/.cached_responses/4d379baf1d6bff9d4918f098c495a5d79ddabed6 @@ -0,0 +1 @@ +s:6166:"{"geonames":[{"distance":"0.00019","timezone":{"gmtOffset":0,"timeZoneId":"Europe/London","dstOffset":1},"countryId":"2635167","fcl":"P","adminId2":"2648110","countryCode":"GB","adminId1":"6269131","lat":"51.50853","fcode":"PPLC","continentCode":"EU","elevation":0,"adminCode2":"GLA","adminCode1":"ENG","lng":"-0.12574","geonameId":2643743,"toponymName":"London","population":7556900,"adminName5":"","adminName4":"","adminName3":"","alternateNames":[{"name":"Лондан","lang":"ab"},{"name":"Londen","lang":"af"},{"name":"London","lang":"als"},{"name":"ለንደን","lang":"am"},{"name":"Londres","lang":"an"},{"name":"Lunden","lang":"ang"},{"name":"لندن","lang":"ar"},{"name":"ܠܘܢܕܘܢ","lang":"arc"},{"name":"لندن","lang":"arz"},{"name":"Londres","lang":"ast"},{"name":"London","lang":"az"},{"name":"Лондон","lang":"ba"},{"name":"Londres","lang":"bcl"},{"name":"Горад Лондан","lang":"be"},{"name":"Лондон","lang":"bg"},{"name":"লন্ডন","lang":"bn"},{"name":"ལོན་ཊོན།","lang":"bo"},{"name":"Londrez","lang":"br"},{"name":"London","lang":"bs"},{"name":"Londres","lang":"ca"},{"name":"Lùng-dŭng","lang":"cdo"},{"name":"ᎫᎴ ᏗᏍᎪᏂᎯᏱ","lang":"chr"},{"name":"لەندەن","lang":"ckb"},{"name":"Londra","lang":"co"},{"name":"Londýn","lang":"cs"},{"name":"Лондонъ","lang":"cu"},{"name":"Лондон","lang":"cv"},{"name":"Llundain","lang":"cy"},{"name":"London","lang":"da"},{"name":"London","lang":"de"},{"name":"Londra","lang":"diq"},{"name":"Λονδίνο","lang":"el"},{"name":"London","lang":"en"},{"name":"Londono","lang":"eo"},{"name":"Londres","lang":"es"},{"name":"London","lang":"et"},{"name":"London","lang":"eu"},{"name":"Londri","lang":"ext"},{"name":"لندن","lang":"fa"},{"name":"Lontoo","lang":"fi"},{"name":"Londres","lang":"fr"},{"name":"Londres","lang":"frp"},{"name":"Londen","lang":"fy"},{"name":"Londain","lang":"ga"},{"name":"倫敦","lang":"gan"},{"name":"Lunnainn","lang":"gd"},{"name":"Londres","lang":"gl"},{"name":"Londye","lang":"gn"},{"name":"લંડન","lang":"gu"},{"name":"Lunnin","lang":"gv"},{"name":"Lākana","lang":"haw"},{"name":"London","lang":"hbs"},{"name":"לונדון","lang":"he"},{"name":"लंदन","lang":"hi"},{"name":"London","lang":"hr"},{"name":"Lonn","lang":"ht"},{"name":"London","lang":"hu"},{"name":"Լոնդոն","lang":"hy"},{"name":"London","lang":"ia"},{"name":"LON","lang":"iata"},{"name":"London","lang":"id"},{"name":"Londres","lang":"ilo"},{"name":"London","lang":"io"},{"name":"London","lang":"is"},{"name":"Londra","lang":"it"},{"name":"ロンドン","lang":"ja"},{"name":"london","lang":"jbo"},{"name":"ლონდონი","lang":"ka"},{"name":"Лондон","lang":"kk"},{"name":"ಲಂಡನ್","lang":"kn"},{"name":"런던","lang":"ko"},{"name":"Лондон","lang":"koi"},{"name":"Лондон","lang":"krc"},{"name":"London","lang":"ku"},{"name":"Лондон","lang":"kv"},{"name":"Loundres","lang":"kw"},{"name":"Лондон","lang":"ky"},{"name":"Londinium","lang":"la"},{"name":"Londra","lang":"lad"},{"name":"London","lang":"lb"},{"name":"Лондон","lang":"lbe"},{"name":"Лондон","lang":"lez"},{"name":"Londe","lang":"li"},{"name":"Londra","lang":"lij"},{"name":"http://en.wikipedia.org/wiki/London","lang":"link"},{"name":"Lundra","lang":"lmo"},{"name":"Londoni","lang":"ln"},{"name":"ລອນດອນ","lang":"lo"},{"name":"Londonas","lang":"lt"},{"name":"Londona","lang":"lv"},{"name":"Лондон","lang":"mhr"},{"name":"Rānana","lang":"mi"},{"name":"Лондон","lang":"mk"},{"name":"ലണ്ടൻ","lang":"ml"},{"name":"Лондон","lang":"mn"},{"name":"लंडन","lang":"mr"},{"name":"Лондон","lang":"mrj"},{"name":"London","lang":"ms"},{"name":"Londra","lang":"mt"},{"name":"Londres","lang":"mwl"},{"name":"လန်ဒန်မြို့","lang":"my"},{"name":"لندن","lang":"mzn"},{"name":"Londres","lang":"nah"},{"name":"Londra","lang":"nap"},{"name":"London","lang":"nds"},{"name":"लण्डन","lang":"ne"},{"name":"लण्डन","lang":"new"},{"name":"Londen","lang":"nl"},{"name":"London","lang":"nn"},{"name":"London","lang":"no"},{"name":"Londres","lang":"nrm"},{"name":"Londres","lang":"oc"},{"name":"ଲଣ୍ଡନ","lang":"or"},{"name":"Лондон","lang":"os"},{"name":"Londe","lang":"pcd"},{"name":"Londyn","lang":"pl"},{"name":"Londra","lang":"pms"},{"name":"لندن","lang":"pnb"},{"name":"Λονδίνο","lang":"pnt"},{"name":"لندن","lang":"ps"},{"name":"Londres","lang":"pt"},{"name":"London","lang":"qu"},{"name":"Londra","lang":"rm"},{"name":"Londra","lang":"ro"},{"name":"Лондон","lang":"ru"},{"name":"Лондон","lang":"rue"},{"name":"लन्डन्","lang":"sa"},{"name":"Лондон","lang":"sah"},{"name":"Londra","lang":"sc"},{"name":"Londra","lang":"scn"},{"name":"Lunnon","lang":"sco"},{"name":"ලන්ඩන්","lang":"si"},{"name":"Londýn","lang":"sk"},{"name":"London","lang":"sl"},{"name":"Londra","lang":"sq"},{"name":"Лондон","lang":"sr"},{"name":"London","lang":"sv"},{"name":"Lůndůn","lang":"szl"},{"name":"இலண்டன்","lang":"ta"},{"name":"లండన్","lang":"te"},{"name":"Londres","lang":"tet"},{"name":"Лондон","lang":"tg"},{"name":"ลอนดอน","lang":"th"},{"name":"Londres","lang":"tl"},{"name":"Landen","lang":"tpi"},{"name":"Londra","lang":"tr"},{"name":"Лондон","lang":"tt"},{"name":"Лондон","lang":"udm"},{"name":"لوندون","lang":"ug"},{"name":"Лондон","lang":"uk"},{"name":"لندن","lang":"ur"},{"name":"Łondra","lang":"vec"},{"name":"Luân Đôn","lang":"vi"},{"name":"Londn","lang":"vls"},{"name":"London","lang":"vo"},{"name":"Londar","lang":"wo"},{"name":"伦敦","lang":"wuu"},{"name":"ლონდონი","lang":"xmf"},{"name":"לאנדאן","lang":"yi"},{"name":"Lọndọnu","lang":"yo"},{"name":"Londen","lang":"zea"},{"name":"伦敦","lang":"zh"},{"name":"伦敦","lang":"zh-CN"},{"name":"ILondon","lang":"zu"}],"adminName2":"Greater London","name":"Londra","fclName":"city, village,...","countryName":"Regno Unito","fcodeName":"capital of a political entity","adminName1":"Inghilterra"}]}"; \ No newline at end of file diff --git a/tests/.cached_responses/4e7ce2b76b1ff075f3321fa338f14e4a69889a84 b/tests/.cached_responses/4e7ce2b76b1ff075f3321fa338f14e4a69889a84 deleted file mode 100644 index 402f6ab88..000000000 --- a/tests/.cached_responses/4e7ce2b76b1ff075f3321fa338f14e4a69889a84 +++ /dev/null @@ -1,9 +0,0 @@ -s:275:" - - 49.831515 - -119.381857 - V1W3Z9 - -4208GALLAGHERS SKelownaBC - -"; \ No newline at end of file diff --git a/tests/.cached_responses/7872917011857c419d626afc4e9e42674eeec00c b/tests/.cached_responses/54c426ed3f2869a1b52d74736ddbed5280b87762 similarity index 74% rename from tests/.cached_responses/7872917011857c419d626afc4e9e42674eeec00c rename to tests/.cached_responses/54c426ed3f2869a1b52d74736ddbed5280b87762 index e96cfc9ef..5a825471c 100644 --- a/tests/.cached_responses/7872917011857c419d626afc4e9e42674eeec00c +++ b/tests/.cached_responses/54c426ed3f2869a1b52d74736ddbed5280b87762 @@ -1,4 +1,4 @@ -s:9328:"{ +s:10573:"{ "licenses" : [ { "name" : "CC-BY-SA", @@ -11,14 +11,22 @@ s:9328:"{ ], "rate" : { "limit" : 2500, - "remaining" : 2492, - "reset" : 1418601600 + "remaining" : 2477, + "reset" : 1422835200 }, "results" : [ { "annotations" : { + "DMS" : { + "lat" : "52\u00b0 22' 28.12044'' N", + "lng" : "9\u00b0 44' 18.79152'' E" + }, "MGRS" : "32UND5027702946", "Maidenhead" : "JO42ui89pu", + "Mercator" : { + "x" : 1084090.783, + "y" : 6834256.383 + }, "OSM" : { "url" : "http://www.openstreetmap.org/?mlat=52.37448&mlon=9.73855#map=17/52.37448/9.73855" }, @@ -26,14 +34,14 @@ s:9328:"{ "geohash" : "u1qcvw7rkwrd4tdd9ej3", "sun" : { "rise" : { - "astronomical" : 1418534100, - "civil" : 1418539260, - "nautical" : 1418536620 + "astronomical" : 1422766980, + "civil" : 1422771780, + "nautical" : 1422769320 }, "set" : { - "astronomical" : 1418577360, - "civil" : 1418572260, - "nautical" : 1418574900 + "astronomical" : 1422814020, + "civil" : 1422809220, + "nautical" : 1422811680 } }, "timezone" : { @@ -73,8 +81,16 @@ s:9328:"{ }, { "annotations" : { + "DMS" : { + "lat" : "37\u00b0 44' 41.21880'' N", + "lng" : "77\u00b0 26' 47.09940'' W" + }, "MGRS" : "18STG8445280316", "Maidenhead" : "FM17gr68kr", + "Mercator" : { + "x" : -8621295.649, + "y" : 4517275.615 + }, "OSM" : { "url" : "http://www.openstreetmap.org/?mlat=37.74478&mlon=-77.44642#map=17/37.74478/-77.44642" }, @@ -82,14 +98,14 @@ s:9328:"{ "geohash" : "dq8ytxjpr9w2ccu2qg42", "sun" : { "rise" : { - "astronomical" : 1418553720, - "civil" : 1418557620, - "nautical" : 1418555640 + "astronomical" : 1422787320, + "civil" : 1422791040, + "nautical" : 1422789180 }, "set" : { - "astronomical" : 1418599680, - "civil" : 1418595780, - "nautical" : 1418597760 + "astronomical" : 1422749100, + "civil" : 1422831780, + "nautical" : 1422833640 } }, "timezone" : { @@ -128,8 +144,16 @@ s:9328:"{ }, { "annotations" : { + "DMS" : { + "lat" : "18\u00b0 23' 2.57604'' N", + "lng" : "78\u00b0 7' 53.34698'' W" + }, "MGRS" : "17QRA0310635070", "Maidenhead" : "FK08wj42fe", + "Mercator" : { + "x" : -8697557.155, + "y" : 2069080.962 + }, "OSM" : { "url" : "http://www.openstreetmap.org/?mlat=18.38405&mlon=-78.13149#map=17/18.38405/-78.13149" }, @@ -137,14 +161,14 @@ s:9328:"{ "geohash" : "d722w4dqu7n5263h1jy1", "sun" : { "rise" : { - "astronomical" : 1418552220, - "civil" : 1418555520, - "nautical" : 1418553840 + "astronomical" : 1422786600, + "civil" : 1422789720, + "nautical" : 1422788160 }, "set" : { - "astronomical" : 1418601480, - "civil" : 1418598240, - "nautical" : 1418599860 + "astronomical" : 1422750180, + "civil" : 1422833460, + "nautical" : 1422835020 } }, "timezone" : { @@ -183,8 +207,16 @@ s:9328:"{ }, { "annotations" : { + "DMS" : { + "lat" : "43\u00b0 42' 11.90628'' N", + "lng" : "72\u00b0 17' 18.83868'' W" + }, "MGRS" : "18TYP1847042493", "Maidenhead" : "FN33uq58it", + "Mercator" : { + "x" : -8047126.391, + "y" : 5390110.179 + }, "OSM" : { "url" : "http://www.openstreetmap.org/?mlat=43.70331&mlon=-72.28857#map=17/43.70331/-72.28857" }, @@ -192,14 +224,14 @@ s:9328:"{ "geohash" : "dru8e5cn4qfnv2p2v8kr", "sun" : { "rise" : { - "astronomical" : 1418553000, - "civil" : 1418557260, - "nautical" : 1418555100 + "astronomical" : 1422786300, + "civil" : 1422790380, + "nautical" : 1422788340 }, "set" : { - "astronomical" : 1418597880, - "civil" : 1418593620, - "nautical" : 1418595780 + "astronomical" : 1422834060, + "civil" : 1422829980, + "nautical" : 1422832020 } }, "timezone" : { @@ -239,8 +271,16 @@ s:9328:"{ }, { "annotations" : { + "DMS" : { + "lat" : "39\u00b0 48' 22.76892'' N", + "lng" : "76\u00b0 59' 3.38460'' W" + }, "MGRS" : "18SUK3013908144", "Maidenhead" : "FM19mt13vm", + "Mercator" : { + "x" : -8569850.125, + "y" : 4810477.842 + }, "OSM" : { "url" : "http://www.openstreetmap.org/?mlat=39.80632&mlon=-76.98427#map=17/39.80632/-76.98427" }, @@ -248,14 +288,14 @@ s:9328:"{ "geohash" : "dr162ntb8kv053u9scnp", "sun" : { "rise" : { - "astronomical" : 1418553780, - "civil" : 1418557800, - "nautical" : 1418555760 + "astronomical" : 1422787320, + "civil" : 1422791160, + "nautical" : 1422789180 }, "set" : { - "astronomical" : 1418599380, - "civil" : 1418595360, - "nautical" : 1418597400 + "astronomical" : 1422748920, + "civil" : 1422831480, + "nautical" : 1422833400 } }, "timezone" : { @@ -300,8 +340,8 @@ s:9328:"{ }, "thanks" : "For using an OpenCage Data API", "timestamp" : { - "created_http" : "Sun, 14 Dec 2014 18:40:41 GMT", - "created_unix" : 1418582441 + "created_http" : "Sun, 01 Feb 2015 16:13:41 GMT", + "created_unix" : 1422807221 }, "total_results" : 5, "we_are_hiring" : "http://lokku.com/#jobs" diff --git a/tests/.cached_responses/550269b02d4e7b169acc513d86f0498d2f42d064 b/tests/.cached_responses/550269b02d4e7b169acc513d86f0498d2f42d064 index 57e951baa..e25ba7d02 100644 --- a/tests/.cached_responses/550269b02d4e7b169acc513d86f0498d2f42d064 +++ b/tests/.cached_responses/550269b02d4e7b169acc513d86f0498d2f42d064 @@ -1 +1 @@ -s:4047:"{"response":{"Attribution":"","GeoObjectCollection":{"metaDataProperty":{"GeocoderResponseMetaData":{"request":"2.388772,48.863216","found":"41","results":"5","boundedBy":{"Envelope":{"lowerCorner":"2.386276 48.860723","upperCorner":"2.391270 48.865713"}},"Point":{"pos":"2.388772 48.863216"},"kind":"street"}},"featureMember":[{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"France, Ile-de-France, Avenue Gambetta","precision":"street","AddressDetails":{"Country":{"AddressLine":"Ile-de-France, Avenue Gambetta","CountryNameCode":"FR","CountryName":"France","AdministrativeArea":{"AdministrativeAreaName":"Ile-de-France","Locality":{"Thoroughfare":{"ThoroughfareName":"Avenue Gambetta"}}}}}}},"description":"Ile-de-France, France","name":"Avenue Gambetta","boundedBy":{"Envelope":{"lowerCorner":"2.387497 48.86294","upperCorner":"2.423214 48.877067"}},"Point":{"pos":"2.403937 48.871231"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"France, Ile-de-France, Paris, 20e Arrondissement, Place Auguste Métivier","precision":"street","AddressDetails":{"Country":{"AddressLine":"Ile-de-France, Paris, 20e Arrondissement, Place Auguste Métivier","CountryNameCode":"FR","CountryName":"France","AdministrativeArea":{"AdministrativeAreaName":"Ile-de-France","Locality":{"LocalityName":"Paris","DependentLocality":{"DependentLocalityName":"20e Arrondissement","Thoroughfare":{"ThoroughfareName":"Place Auguste Métivier"}}}}}}}},"description":"20e Arrondissement, Paris, Ile-de-France, France","name":"Place Auguste Métivier","boundedBy":{"Envelope":{"lowerCorner":"2.387983 48.863029","upperCorner":"2.388468 48.863307"}},"Point":{"pos":"2.388207 48.863189"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"France, Ile-de-France, Paris, 20e Arrondissement, Rue des Amandiers","precision":"street","AddressDetails":{"Country":{"AddressLine":"Ile-de-France, Paris, 20e Arrondissement, Rue des Amandiers","CountryNameCode":"FR","CountryName":"France","AdministrativeArea":{"AdministrativeAreaName":"Ile-de-France","Locality":{"LocalityName":"Paris","DependentLocality":{"DependentLocalityName":"20e Arrondissement","Thoroughfare":{"ThoroughfareName":"Rue des Amandiers"}}}}}}}},"description":"20e Arrondissement, Paris, Ile-de-France, France","name":"Rue des Amandiers","boundedBy":{"Envelope":{"lowerCorner":"2.387983 48.863029","upperCorner":"2.389824 48.868309"}},"Point":{"pos":"2.389689 48.865933"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"France, Ile-de-France, Paris, 20e Arrondissement, Rue Houdart","precision":"street","AddressDetails":{"Country":{"AddressLine":"Ile-de-France, Paris, 20e Arrondissement, Rue Houdart","CountryNameCode":"FR","CountryName":"France","AdministrativeArea":{"AdministrativeAreaName":"Ile-de-France","Locality":{"LocalityName":"Paris","DependentLocality":{"DependentLocalityName":"20e Arrondissement","Thoroughfare":{"ThoroughfareName":"Rue Houdart"}}}}}}}},"description":"20e Arrondissement, Paris, Ile-de-France, France","name":"Rue Houdart","boundedBy":{"Envelope":{"lowerCorner":"2.387282 48.86323","upperCorner":"2.388261 48.864599"}},"Point":{"pos":"2.387767 48.863918"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"France, Ile-de-France, Paris, 20e Arrondissement, Square Jacaques Grynberg","precision":"street","AddressDetails":{"Country":{"AddressLine":"Ile-de-France, Paris, 20e Arrondissement, Square Jacaques Grynberg","CountryNameCode":"FR","CountryName":"France","AdministrativeArea":{"AdministrativeAreaName":"Ile-de-France","Locality":{"LocalityName":"Paris","DependentLocality":{"DependentLocalityName":"20e Arrondissement","Thoroughfare":{"ThoroughfareName":"Square Jacaques Grynberg"}}}}}}}},"description":"20e Arrondissement, Paris, Ile-de-France, France","name":"Square Jacaques Grynberg","boundedBy":{"Envelope":{"lowerCorner":"2.388899 48.86371","upperCorner":"2.389959 48.863929"}},"Point":{"pos":"2.389438 48.863758"}}}]}}}"; \ No newline at end of file +s:4530:"{"response":{"Attribution":"","GeoObjectCollection":{"metaDataProperty":{"GeocoderResponseMetaData":{"request":"2.388772,48.863216","found":"46","results":"5","boundedBy":{"Envelope":{"lowerCorner":"2.386276 48.860723","upperCorner":"2.391270 48.865713"}},"Point":{"pos":"2.388772 48.863216"},"kind":"street"}},"featureMember":[{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"France, Ile-de-France, Paris, 20e Arrondissement, Avenue Gambetta","precision":"street","AddressDetails":{"Country":{"AddressLine":"Ile-de-France, Paris, 20e Arrondissement, Avenue Gambetta","CountryNameCode":"FR","CountryName":"France","AdministrativeArea":{"AdministrativeAreaName":"Ile-de-France","SubAdministrativeArea":{"SubAdministrativeAreaName":"Paris","Locality":{"LocalityName":"Paris","DependentLocality":{"DependentLocalityName":"20e Arrondissement","Thoroughfare":{"ThoroughfareName":"Avenue Gambetta"}}}}}}}}},"description":"20e Arrondissement, Paris, Ile-de-France, France","name":"Avenue Gambetta","boundedBy":{"Envelope":{"lowerCorner":"2.387497 48.86294","upperCorner":"2.406587 48.877067"}},"Point":{"pos":"2.400370 48.867035"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"France, Ile-de-France, Paris, 20e Arrondissement, Place Auguste Métivier","precision":"street","AddressDetails":{"Country":{"AddressLine":"Ile-de-France, Paris, 20e Arrondissement, Place Auguste Métivier","CountryNameCode":"FR","CountryName":"France","AdministrativeArea":{"AdministrativeAreaName":"Ile-de-France","SubAdministrativeArea":{"SubAdministrativeAreaName":"Paris","Locality":{"LocalityName":"Paris","DependentLocality":{"DependentLocalityName":"20e Arrondissement","Thoroughfare":{"ThoroughfareName":"Place Auguste Métivier"}}}}}}}}},"description":"20e Arrondissement, Paris, Ile-de-France, France","name":"Place Auguste Métivier","boundedBy":{"Envelope":{"lowerCorner":"2.387974 48.863029","upperCorner":"2.388468 48.863307"}},"Point":{"pos":"2.388207 48.863189"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"France, Ile-de-France, Paris, 20e Arrondissement, Rue des Amandiers","precision":"street","AddressDetails":{"Country":{"AddressLine":"Ile-de-France, Paris, 20e Arrondissement, Rue des Amandiers","CountryNameCode":"FR","CountryName":"France","AdministrativeArea":{"AdministrativeAreaName":"Ile-de-France","SubAdministrativeArea":{"SubAdministrativeAreaName":"Paris","Locality":{"LocalityName":"Paris","DependentLocality":{"DependentLocalityName":"20e Arrondissement","Thoroughfare":{"ThoroughfareName":"Rue des Amandiers"}}}}}}}}},"description":"20e Arrondissement, Paris, Ile-de-France, France","name":"Rue des Amandiers","boundedBy":{"Envelope":{"lowerCorner":"2.387974 48.863029","upperCorner":"2.389815 48.868309"}},"Point":{"pos":"2.389689 48.865927"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"France, Ile-de-France, Paris, 20e Arrondissement, Rue Houdart","precision":"street","AddressDetails":{"Country":{"AddressLine":"Ile-de-France, Paris, 20e Arrondissement, Rue Houdart","CountryNameCode":"FR","CountryName":"France","AdministrativeArea":{"AdministrativeAreaName":"Ile-de-France","SubAdministrativeArea":{"SubAdministrativeAreaName":"Paris","Locality":{"LocalityName":"Paris","DependentLocality":{"DependentLocalityName":"20e Arrondissement","Thoroughfare":{"ThoroughfareName":"Rue Houdart"}}}}}}}}},"description":"20e Arrondissement, Paris, Ile-de-France, France","name":"Rue Houdart","boundedBy":{"Envelope":{"lowerCorner":"2.387273 48.863224","upperCorner":"2.388252 48.864599"}},"Point":{"pos":"2.387767 48.863912"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"France, Ile-de-France, Paris, 20e Arrondissement, Square Jacaques Grynberg","precision":"street","AddressDetails":{"Country":{"AddressLine":"Ile-de-France, Paris, 20e Arrondissement, Square Jacaques Grynberg","CountryNameCode":"FR","CountryName":"France","AdministrativeArea":{"AdministrativeAreaName":"Ile-de-France","SubAdministrativeArea":{"SubAdministrativeAreaName":"Paris","Locality":{"LocalityName":"Paris","DependentLocality":{"DependentLocalityName":"20e Arrondissement","Thoroughfare":{"ThoroughfareName":"Square Jacaques Grynberg"}}}}}}}}},"description":"20e Arrondissement, Paris, Ile-de-France, France","name":"Square Jacaques Grynberg","boundedBy":{"Envelope":{"lowerCorner":"2.388899 48.863704","upperCorner":"2.389959 48.863929"}},"Point":{"pos":"2.389438 48.863758"}}}]}}}"; \ No newline at end of file diff --git a/tests/.cached_responses/5508e82fab1b2602a2125179fcb1a5d175bab9dc b/tests/.cached_responses/5508e82fab1b2602a2125179fcb1a5d175bab9dc new file mode 100644 index 000000000..9567e0beb --- /dev/null +++ b/tests/.cached_responses/5508e82fab1b2602a2125179fcb1a5d175bab9dc @@ -0,0 +1 @@ +s:1994:"55.70438912.546129u3buvkxv9fxzTomTomMap422poi7311Uno-X0Uno-X0180.0TagensvejCopenhagenDenmarkDNK2200Uno-X, Tagensvej 422, 2200, Copenhagen, DNKfalse111.01.00"; \ No newline at end of file diff --git a/tests/.cached_responses/2dc5ff095533a97d537c2f9daedff80820f88294 b/tests/.cached_responses/563c0ee41772350b9055aaef1ef92330f1e6d698 similarity index 100% rename from tests/.cached_responses/2dc5ff095533a97d537c2f9daedff80820f88294 rename to tests/.cached_responses/563c0ee41772350b9055aaef1ef92330f1e6d698 diff --git a/tests/.cached_responses/57b9558f363cbecf50955298cf92148e7bf4093c b/tests/.cached_responses/57b9558f363cbecf50955298cf92148e7bf4093c index 7ef8dbcc6..310375a81 100644 --- a/tests/.cached_responses/57b9558f363cbecf50955298cf92148e7bf4093c +++ b/tests/.cached_responses/57b9558f363cbecf50955298cf92148e7bf4093c @@ -1,3 +1,3 @@ -s:870:" - -35, Läntinen Pitkäkatu, VII, Turku, Varsinais-Suomi, Lounais-Suomen aluehallintovirasto, 20100, Suomi, European Union35Läntinen PitkäkatuVIITurkuVarsinais-SuomiLounais-Suomen aluehallintovirasto20100SuomifiEuropean Union"; \ No newline at end of file +s:875:" + +35, Läntinen Pitkäkatu, VII, Turku, Varsinais-Suomi, Lounais-Suomen aluehallintovirasto, Etelä-Suomi, 20100, Suomi35Läntinen PitkäkatuVIITurkuVarsinais-SuomiLounais-Suomen aluehallintovirastoEtelä-Suomi20100Suomifi"; \ No newline at end of file diff --git a/tests/.cached_responses/58a6cd7c553341f996bbbd6cfe01ce27c87c055d b/tests/.cached_responses/58a6cd7c553341f996bbbd6cfe01ce27c87c055d deleted file mode 100644 index d9c341c92..000000000 --- a/tests/.cached_responses/58a6cd7c553341f996bbbd6cfe01ce27c87c055d +++ /dev/null @@ -1,35 +0,0 @@ -s:754:" - - - - 40.707507 - -74.011255 - NEW YORK - NY - 10005 - 1 - New St - 40.707507 - -74.011255 - 0 - - - - - 40.707507 - -74.011255 - NEW YORK - NY - 10005 - 1 - New St - 40.707507 - -74.011255 - 0 - - - - - - -"; \ No newline at end of file diff --git a/tests/.cached_responses/5cd188e0df96f4069ca38190fb38b53681dac5e6 b/tests/.cached_responses/5cd188e0df96f4069ca38190fb38b53681dac5e6 index f166baa42..b0ae89e5f 100644 --- a/tests/.cached_responses/5cd188e0df96f4069ca38190fb38b53681dac5e6 +++ b/tests/.cached_responses/5cd188e0df96f4069ca38190fb38b53681dac5e6 @@ -1 +1 @@ -s:4207:"{"response":{"Attribution":"","GeoObjectCollection":{"metaDataProperty":{"GeocoderResponseMetaData":{"request":"Copenhagen, Denmark","found":"9","results":"5"}},"featureMember":[{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"locality","text":"Данія, Столичная область, Копенгаген","precision":"other","AddressDetails":{"Country":{"AddressLine":"Столичная область, Копенгаген","CountryNameCode":"DK","CountryName":"Данія","AdministrativeArea":{"AdministrativeAreaName":"Столичная область","Locality":{"LocalityName":"Копенгаген"}}}}}},"description":"Столичная область, Данія","name":"Копенгаген","boundedBy":{"Envelope":{"lowerCorner":"12.45295 55.614999","upperCorner":"12.652043 55.73259"}},"Point":{"pos":"12.567602 55.675682"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"airport","text":"Данія, Столичная область, Копенгаген Луфтаун Каструп","precision":"other","AddressDetails":{"Country":{"AddressLine":"Столичная область, Копенгаген Луфтаун Каструп","CountryNameCode":"DK","CountryName":"Данія","AdministrativeArea":{"AdministrativeAreaName":"Столичная область","Locality":{"Premise":{"PremiseName":"Копенгаген Луфтаун Каструп"}}}}}}},"description":"Столичная область, Данія","name":"Копенгаген Луфтаун Каструп","boundedBy":{"Envelope":{"lowerCorner":"12.596168 55.586741","upperCorner":"12.679819 55.632438"}},"Point":{"pos":"12.644740 55.614058"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"district","text":"Данія, Столичная область, Копенгаген, Копенгаген НВ","precision":"other","AddressDetails":{"Country":{"AddressLine":"Столичная область, Копенгаген, Копенгаген НВ","CountryNameCode":"DK","CountryName":"Данія","AdministrativeArea":{"AdministrativeAreaName":"Столичная область","Locality":{"LocalityName":"Копенгаген","DependentLocality":{"DependentLocalityName":"Копенгаген НВ"}}}}}}},"description":"Копенгаген, Столичная область, Данія","name":"Копенгаген НВ","boundedBy":{"Envelope":{"lowerCorner":"12.518464 55.703961","upperCorner":"12.551396 55.722553"}},"Point":{"pos":"12.534930 55.713258"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"district","text":"Данія, Столичная область, Копенгаген, Копенгаген Э","precision":"other","AddressDetails":{"Country":{"AddressLine":"Столичная область, Копенгаген, Копенгаген Э","CountryNameCode":"DK","CountryName":"Данія","AdministrativeArea":{"AdministrativeAreaName":"Столичная область","Locality":{"LocalityName":"Копенгаген","DependentLocality":{"DependentLocalityName":"Копенгаген Э"}}}}}}},"description":"Копенгаген, Столичная область, Данія","name":"Копенгаген Э","boundedBy":{"Envelope":{"lowerCorner":"12.561744 55.689578","upperCorner":"12.594677 55.708176"}},"Point":{"pos":"12.578211 55.698878"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"district","text":"Данія, Столичная область, Копенгаген, Копенгаген Н","precision":"other","AddressDetails":{"Country":{"AddressLine":"Столичная область, Копенгаген, Копенгаген Н","CountryNameCode":"DK","CountryName":"Данія","AdministrativeArea":{"AdministrativeAreaName":"Столичная область","Locality":{"LocalityName":"Копенгаген","DependentLocality":{"DependentLocalityName":"Копенгаген Н"}}}}}}},"description":"Копенгаген, Столичная область, Данія","name":"Копенгаген Н","boundedBy":{"Envelope":{"lowerCorner":"12.538361 55.681077","upperCorner":"12.571294 55.69968"}},"Point":{"pos":"12.554827 55.690380"}}}]}}}"; \ No newline at end of file +s:4502:"{"response":{"Attribution":"","GeoObjectCollection":{"metaDataProperty":{"GeocoderResponseMetaData":{"request":"Copenhagen, Denmark","found":"13","results":"5"}},"featureMember":[{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"locality","text":"Данія, Столичная область, Копенгаген","precision":"other","AddressDetails":{"Country":{"AddressLine":"Столичная область, Копенгаген","CountryNameCode":"DK","CountryName":"Данія","AdministrativeArea":{"AdministrativeAreaName":"Столичная область","SubAdministrativeArea":{"SubAdministrativeAreaName":"Копенгаген","Locality":{"LocalityName":"Копенгаген"}}}}}}},"description":"Столичная область, Данія","name":"Копенгаген","boundedBy":{"Envelope":{"lowerCorner":"12.45295 55.614999","upperCorner":"12.65075 55.732585"}},"Point":{"pos":"12.567593 55.675676"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"locality","text":"Данія, область Южная Дания, Миддельфарт, Копенгаген","precision":"other","AddressDetails":{"Country":{"AddressLine":"область Южная Дания, Миддельфарт, Копенгаген","CountryNameCode":"DK","CountryName":"Данія","AdministrativeArea":{"AdministrativeAreaName":"область Южная Дания","SubAdministrativeArea":{"SubAdministrativeAreaName":"Миддельфарт","Locality":{"LocalityName":"Копенгаген"}}}}}}},"description":"Миддельфарт, область Южная Дания, Данія","name":"Копенгаген","boundedBy":{"Envelope":{"lowerCorner":"9.971219 55.454366","upperCorner":"9.974965 55.457398"}},"Point":{"pos":"9.972854 55.455739"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"district","text":"Данія, Столичная область, Копенгаген, Копенгаген","precision":"other","AddressDetails":{"Country":{"AddressLine":"Столичная область, Копенгаген, Копенгаген","CountryNameCode":"DK","CountryName":"Данія","AdministrativeArea":{"AdministrativeAreaName":"Столичная область","SubAdministrativeArea":{"SubAdministrativeAreaName":"Копенгаген","Locality":{"LocalityName":"Копенгаген","DependentLocality":{"DependentLocalityName":"Копенгаген"}}}}}}}},"description":"Копенгаген, Столичная область, Данія","name":"Копенгаген","boundedBy":{"Envelope":{"lowerCorner":"12.518464 55.703961","upperCorner":"12.551396 55.722553"}},"Point":{"pos":"12.534930 55.713258"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"district","text":"Данія, Столичная область, Копенгаген, Копенгаген","precision":"other","AddressDetails":{"Country":{"AddressLine":"Столичная область, Копенгаген, Копенгаген","CountryNameCode":"DK","CountryName":"Данія","AdministrativeArea":{"AdministrativeAreaName":"Столичная область","SubAdministrativeArea":{"SubAdministrativeAreaName":"Копенгаген","Locality":{"LocalityName":"Копенгаген","DependentLocality":{"DependentLocalityName":"Копенгаген"}}}}}}}},"description":"Копенгаген, Столичная область, Данія","name":"Копенгаген","boundedBy":{"Envelope":{"lowerCorner":"12.561736 55.689578","upperCorner":"12.594668 55.708176"}},"Point":{"pos":"12.578202 55.698878"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"district","text":"Данія, Столичная область, Копенгаген, Копенгаген","precision":"other","AddressDetails":{"Country":{"AddressLine":"Столичная область, Копенгаген, Копенгаген","CountryNameCode":"DK","CountryName":"Данія","AdministrativeArea":{"AdministrativeAreaName":"Столичная область","SubAdministrativeArea":{"SubAdministrativeAreaName":"Копенгаген","Locality":{"LocalityName":"Копенгаген","DependentLocality":{"DependentLocalityName":"Копенгаген"}}}}}}}},"description":"Копенгаген, Столичная область, Данія","name":"Копенгаген","boundedBy":{"Envelope":{"lowerCorner":"12.538361 55.681077","upperCorner":"12.571294 55.69968"}},"Point":{"pos":"12.554827 55.690380"}}}]}}}"; \ No newline at end of file diff --git a/tests/.cached_responses/5e542f2d489819bf630880fe3703ad51881dd472 b/tests/.cached_responses/5e542f2d489819bf630880fe3703ad51881dd472 deleted file mode 100644 index ebfcad47d..000000000 --- a/tests/.cached_responses/5e542f2d489819bf630880fe3703ad51881dd472 +++ /dev/null @@ -1 +0,0 @@ -s:33:"couldn't find this address! sorry"; \ No newline at end of file diff --git a/tests/.cached_responses/007b18894c37cb365c2364dd1dad71b20e0e57dc b/tests/.cached_responses/626469fcef9b339686ba97899b36e1861c5d8002 similarity index 100% rename from tests/.cached_responses/007b18894c37cb365c2364dd1dad71b20e0e57dc rename to tests/.cached_responses/626469fcef9b339686ba97899b36e1861c5d8002 diff --git a/tests/.cached_responses/63381be06387797543fe6786a5e5da7a14aaf52a b/tests/.cached_responses/63381be06387797543fe6786a5e5da7a14aaf52a deleted file mode 100644 index e73ac9217..000000000 --- a/tests/.cached_responses/63381be06387797543fe6786a5e5da7a14aaf52a +++ /dev/null @@ -1,147 +0,0 @@ -s:4223:"{ - "licenses" : [ - { - "name" : "CC-BY-SA", - "url" : "http://creativecommons.org/licenses/by-sa/3.0/" - }, - { - "name" : "ODbL", - "url" : "http://opendatacommons.org/licenses/odbl/summary/" - } - ], - "rate" : { - "limit" : 2500, - "remaining" : 2451, - "reset" : 1410393600 - }, - "results" : [ - { - "annotations" : { - "OSM" : { - "url" : "http://www.openstreetmap.org/?mlat=48.86319&mlon=2.38909#map=17/48.86319/2.38909" - }, - "geohash" : "u09tyr78tz64jdcgfnhe", - "timezone" : { - "name" : "Europe/Paris", - "now_in_dst" : 1, - "offset_sec" : 7200, - "offset_string" : 200, - "short_name" : "CEST" - } - }, - "bounds" : { - "northeast" : { - "lat" : 48.8632427, - "lng" : 2.3891394 - }, - "southwest" : { - "lat" : 48.8631427, - "lng" : 2.3890394 - } - }, - "components" : { - "city" : "Paris", - "city_district" : "20th Arrondissement", - "country" : "France", - "country_code" : "FR", - "county" : "Paris", - "house_number" : 10, - "neighbourhood" : "M\u00e9nilmontant", - "postcode" : 75020, - "road" : "Avenue Gambetta", - "state" : "Ile-de-France", - "suburb" : "P\u00e8re-Lachaise" - }, - "confidence" : 10, - "formatted" : "10, Avenue Gambetta, P\u00e8re-Lachaise, M\u00e9nilmontant, 20th Arrondissement, Paris, Paris, 75020, Ile-de-France, France", - "geometry" : { - "lat" : 48.8631927, - "lng" : 2.3890894 - } - }, - { - "annotations" : { - "OSM" : { - "url" : "http://www.openstreetmap.org/?mlat=48.86584&mlon=2.40320#map=17/48.86584/2.40320" - }, - "geohash" : "u09tyxvbntnvc0byxfwk", - "timezone" : { - "name" : "Europe/Paris", - "now_in_dst" : 1, - "offset_sec" : 7200, - "offset_string" : 200, - "short_name" : "CEST" - } - }, - "bounds" : { - "northeast" : { - "lat" : 2.417, - "lng" : 48.874933 - }, - "southwest" : { - "lat" : 2.389414, - "lng" : 48.856749 - } - }, - "components" : { - "suburb" : "Gambetta" - }, - "confidence" : 7, - "formatted" : "Gambetta", - "geometry" : { - "lat" : 48.865842, - "lng" : 2.403204 - } - }, - { - "annotations" : { - "OSM" : { - "url" : "http://www.openstreetmap.org/?mlat=48.85341&mlon=2.34880#map=17/48.85341/2.34880" - }, - "geohash" : "u09tvmqrep8np02g7x9y", - "timezone" : { - "name" : "Europe/Paris", - "now_in_dst" : 1, - "offset_sec" : 7200, - "offset_string" : 200, - "short_name" : "CEST" - } - }, - "bounds" : { - "northeast" : { - "lat" : 48.921822, - "lng" : 2.485605 - }, - "southwest" : { - "lat" : 48.796009, - "lng" : 2.216784 - } - }, - "components" : { - "country" : "France", - "county" : "Paris", - "local administrative area" : "Paris", - "state" : "\u00cele-de-France", - "town" : "Paris" - }, - "confidence" : 5, - "formatted" : "Paris, Paris, \u00cele-de-France, France, Paris", - "geometry" : { - "lat" : 48.85341, - "lng" : 2.3488 - } - } - ], - "status" : { - "code" : 200, - "message" : "OK" - }, - "thanks" : "For using an OpenCage Data API", - "timestamp" : { - "created_http" : "Wed, 10 Sep 2014 20:55:20 GMT", - "created_unix" : 1410382520 - }, - "total_results" : 3, - "we_are_hiring" : "http://lokku.com/#jobs" -} -"; \ No newline at end of file diff --git a/tests/.cached_responses/641a9483a3b05446b0e71d9cd117d77661e4701b b/tests/.cached_responses/641a9483a3b05446b0e71d9cd117d77661e4701b deleted file mode 100644 index 5ae6492ad..000000000 --- a/tests/.cached_responses/641a9483a3b05446b0e71d9cd117d77661e4701b +++ /dev/null @@ -1,219 +0,0 @@ -s:6403:"{ - "licenses" : [ - { - "name" : "CC-BY-SA", - "url" : "http://creativecommons.org/licenses/by-sa/3.0/" - }, - { - "name" : "ODbL", - "url" : "http://opendatacommons.org/licenses/odbl/summary/" - } - ], - "rate" : { - "limit" : 2500, - "remaining" : 2447, - "reset" : 1410393600 - }, - "results" : [ - { - "annotations" : { - "OSM" : { - "url" : "http://www.openstreetmap.org/?mlat=52.37448&mlon=9.73855#map=17/52.37448/9.73855" - }, - "geohash" : "u1qcvw7rkwrd4tdd9ej3", - "timezone" : { - "name" : "Europe/Berlin", - "now_in_dst" : 1, - "offset_sec" : 7200, - "offset_string" : 200, - "short_name" : "CEST" - } - }, - "bounds" : { - "northeast" : { - "lat" : 52.4543349, - "lng" : 9.9186208 - }, - "southwest" : { - "lat" : 52.3051373, - "lng" : 9.60443 - } - }, - "components" : { - "city" : "Hanover", - "country" : "Germany", - "country_code" : "de", - "county" : "Region Hannover", - "state" : "Lower Saxony" - }, - "confidence" : 5, - "formatted" : "Hanover, Germany", - "geometry" : { - "lat" : 52.3744779, - "lng" : 9.7385532 - } - }, - { - "annotations" : { - "OSM" : { - "url" : "http://www.openstreetmap.org/?mlat=37.74478&mlon=-77.44642#map=17/37.74478/-77.44642" - }, - "geohash" : "dq8ytxjpr9w2ccu2qg42", - "timezone" : { - "name" : "America/New_York", - "now_in_dst" : 1, - "offset_sec" : -14400, - "offset_string" : -400, - "short_name" : "EDT" - } - }, - "bounds" : { - "northeast" : { - "lat" : 38.384783, - "lng" : -76.8064165 - }, - "southwest" : { - "lat" : 37.104783, - "lng" : -78.0864165 - } - }, - "components" : { - "country" : "United States of America", - "country_code" : "US", - "county" : "Hanover", - "state" : "Virginia" - }, - "confidence" : 1, - "formatted" : "Hanover, Virginia, United States of America", - "geometry" : { - "lat" : 37.744783, - "lng" : -77.4464165 - } - }, - { - "annotations" : { - "OSM" : { - "url" : "http://www.openstreetmap.org/?mlat=18.38405&mlon=-78.13149#map=17/18.38405/-78.13149" - }, - "geohash" : "d722w4dqu7n5263h1jy1", - "timezone" : { - "name" : "America/Jamaica", - "now_in_dst" : 0, - "offset_sec" : -18000, - "offset_string" : -500, - "short_name" : "EST" - } - }, - "bounds" : { - "northeast" : { - "lat" : 18.4629985, - "lng" : -77.9203782 - }, - "southwest" : { - "lat" : 18.3044313, - "lng" : -78.3450397 - } - }, - "components" : { - "country" : "Jamaica", - "country_code" : "JM", - "county" : "Hanover", - "state_district" : "Cornwall County" - }, - "confidence" : 3, - "formatted" : "Hanover, Cornwall County, Jamaica", - "geometry" : { - "lat" : 18.3840489, - "lng" : -78.131485271539 - } - }, - { - "annotations" : { - "OSM" : { - "url" : "http://www.openstreetmap.org/?mlat=43.70331&mlon=-72.28857#map=17/43.70331/-72.28857" - }, - "geohash" : "dru8e5cn4qfnv2p2v8kr", - "timezone" : { - "name" : "America/New_York", - "now_in_dst" : 1, - "offset_sec" : -14400, - "offset_string" : -400, - "short_name" : "EDT" - } - }, - "bounds" : { - "northeast" : { - "lat" : 43.7709495, - "lng" : -72.075688 - }, - "southwest" : { - "lat" : 43.658591, - "lng" : -72.3051329 - } - }, - "components" : { - "city" : "Hanover", - "country" : "United States of America", - "country_code" : "US", - "county" : "Grafton County", - "state" : "New Hampshire" - }, - "confidence" : 5, - "formatted" : "Hanover, Grafton County, New Hampshire, United States of America", - "geometry" : { - "lat" : 43.7033073, - "lng" : -72.2885663 - } - }, - { - "annotations" : { - "OSM" : { - "url" : "http://www.openstreetmap.org/?mlat=39.80632&mlon=-76.98427#map=17/39.80632/-76.98427" - }, - "geohash" : "dr162ntb8kv053u9scnp", - "timezone" : { - "name" : "America/New_York", - "now_in_dst" : 1, - "offset_sec" : -14400, - "offset_string" : -400, - "short_name" : "EDT" - } - }, - "bounds" : { - "northeast" : { - "lat" : 39.832415, - "lng" : -76.9634509 - }, - "southwest" : { - "lat" : 39.791036, - "lng" : -76.9999439 - } - }, - "components" : { - "city" : "Hanover", - "country" : "United States of America", - "country_code" : "US", - "county" : "York County", - "state" : "Pennsylvania" - }, - "confidence" : 7, - "formatted" : "Hanover, York County, Pennsylvania, United States of America", - "geometry" : { - "lat" : 39.8063247, - "lng" : -76.9842735 - } - } - ], - "status" : { - "code" : 200, - "message" : "OK" - }, - "thanks" : "For using an OpenCage Data API", - "timestamp" : { - "created_http" : "Wed, 10 Sep 2014 21:41:48 GMT", - "created_unix" : 1410385308 - }, - "total_results" : 5, - "we_are_hiring" : "http://lokku.com/#jobs" -} -"; \ No newline at end of file diff --git a/tests/.cached_responses/4abafe29c2864454fe15204bd400785d4d8091ee b/tests/.cached_responses/666c1a5489aef43598b1248853f404ce735a178e similarity index 97% rename from tests/.cached_responses/4abafe29c2864454fe15204bd400785d4d8091ee rename to tests/.cached_responses/666c1a5489aef43598b1248853f404ce735a178e index e91ebcc10..67dc834b6 100644 --- a/tests/.cached_responses/4abafe29c2864454fe15204bd400785d4d8091ee +++ b/tests/.cached_responses/666c1a5489aef43598b1248853f404ce735a178e @@ -1,4 +1,4 @@ -s:2423:"{ +s:2417:"{ "results" : [ { "address_components" : [ @@ -19,7 +19,7 @@ s:2423:"{ }, { "long_name" : "New York", - "short_name" : "New York", + "short_name" : "NY", "types" : [ "locality", "political" ] }, { diff --git a/tests/.cached_responses/9ad0226c913e90e9bc8ae8c87b0a5156bf8cbd9b b/tests/.cached_responses/669625b0fc6af9725bd51c74781228e3746265b7 similarity index 74% rename from tests/.cached_responses/9ad0226c913e90e9bc8ae8c87b0a5156bf8cbd9b rename to tests/.cached_responses/669625b0fc6af9725bd51c74781228e3746265b7 index 31608e3b2..69cb97342 100644 --- a/tests/.cached_responses/9ad0226c913e90e9bc8ae8c87b0a5156bf8cbd9b +++ b/tests/.cached_responses/669625b0fc6af9725bd51c74781228e3746265b7 @@ -1,4 +1,4 @@ -s:5808:"{ +s:6548:"{ "licenses" : [ { "name" : "CC-BY-SA", @@ -11,14 +11,22 @@ s:5808:"{ ], "rate" : { "limit" : 2500, - "remaining" : 2494, - "reset" : 1418601600 + "remaining" : 2479, + "reset" : 1422835200 }, "results" : [ { "annotations" : { + "DMS" : { + "lat" : "48\u00b0 51' 47.49372'' N", + "lng" : "2\u00b0 23' 20.72184'' E" + }, "MGRS" : "31UDQ5519412427", "Maidenhead" : "JN18eu67qd", + "Mercator" : { + "x" : 265952.215, + "y" : 6219481.698 + }, "OSM" : { "url" : "http://www.openstreetmap.org/?mlat=48.86319&mlon=2.38909#map=17/48.86319/2.38909" }, @@ -26,14 +34,14 @@ s:5808:"{ "geohash" : "u09tyr78tz64jdcgfnhe", "sun" : { "rise" : { - "astronomical" : 1418535540, - "civil" : 1418540280, - "nautical" : 1418537820 + "astronomical" : 1422768600, + "civil" : 1422773100, + "nautical" : 1422770820 }, "set" : { - "astronomical" : 1418579520, - "civil" : 1418574780, - "nautical" : 1418577180 + "astronomical" : 1422815940, + "civil" : 1422811440, + "nautical" : 1422813720 } }, "timezone" : { @@ -79,22 +87,30 @@ s:5808:"{ }, { "annotations" : { + "DMS" : { + "lat" : "48\u00b0 51' 57.03120'' N", + "lng" : "2\u00b0 24' 11.53440'' E" + }, "MGRS" : "31UDQ5623112713", "Maidenhead" : "JN18eu87jt", + "Mercator" : { + "x" : 267523.446, + "y" : 6219928.706 + }, "OSM" : { "url" : "http://www.openstreetmap.org/?mlat=48.86584&mlon=2.40320#map=17/48.86584/2.40320" }, "geohash" : "u09tyxvbntnvc0byxfwk", "sun" : { "rise" : { - "astronomical" : 1418535540, - "civil" : 1418540280, - "nautical" : 1418537820 + "astronomical" : 1422768600, + "civil" : 1422773100, + "nautical" : 1422770820 }, "set" : { - "astronomical" : 1418579460, - "civil" : 1418574780, - "nautical" : 1418577180 + "astronomical" : 1422815940, + "civil" : 1422811440, + "nautical" : 1422813720 } }, "timezone" : { @@ -130,22 +146,30 @@ s:5808:"{ }, { "annotations" : { + "DMS" : { + "lat" : "48\u00b0 51' 12.27600'' N", + "lng" : "2\u00b0 20' 55.68000'' E" + }, "MGRS" : "31UDQ5223011364", "Maidenhead" : "JN18eu14ut", + "Mercator" : { + "x" : 261467.22, + "y" : 6217831.297 + }, "OSM" : { "url" : "http://www.openstreetmap.org/?mlat=48.85341&mlon=2.34880#map=17/48.85341/2.34880" }, "geohash" : "u09tvmqrep8np02g7x9y", "sun" : { "rise" : { - "astronomical" : 1418535540, - "civil" : 1418540280, - "nautical" : 1418537820 + "astronomical" : 1422768600, + "civil" : 1422773100, + "nautical" : 1422770820 }, "set" : { - "astronomical" : 1418579520, - "civil" : 1418574780, - "nautical" : 1418577180 + "astronomical" : 1422815940, + "civil" : 1422811440, + "nautical" : 1422813720 } }, "timezone" : { @@ -190,8 +214,8 @@ s:5808:"{ }, "thanks" : "For using an OpenCage Data API", "timestamp" : { - "created_http" : "Sun, 14 Dec 2014 18:40:37 GMT", - "created_unix" : 1418582437 + "created_http" : "Sun, 01 Feb 2015 16:13:38 GMT", + "created_unix" : 1422807218 }, "total_results" : 3, "we_are_hiring" : "http://lokku.com/#jobs" diff --git a/tests/.cached_responses/6a7bf47b3d523a1d34f7c4e8801a0fbde5d819f4 b/tests/.cached_responses/6a7bf47b3d523a1d34f7c4e8801a0fbde5d819f4 index 5573257d9..7314db108 100644 --- a/tests/.cached_responses/6a7bf47b3d523a1d34f7c4e8801a0fbde5d819f4 +++ b/tests/.cached_responses/6a7bf47b3d523a1d34f7c4e8801a0fbde5d819f4 @@ -1 +1 @@ -s:896:"{"response":{"Attribution":"","GeoObjectCollection":{"metaDataProperty":{"GeocoderResponseMetaData":{"request":"ул.Ленина, 19, Минск 220030, Республика Беларусь","found":"1","results":"5"}},"featureMember":[{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Беларусь, Минск, улица Ленина, 19","precision":"exact","AddressDetails":{"Country":{"AddressLine":"Минск, улица Ленина, 19","CountryNameCode":"BY","CountryName":"Беларусь","Locality":{"LocalityName":"Минск","Thoroughfare":{"ThoroughfareName":"улица Ленина","Premise":{"PremiseNumber":"19"}}}}}}},"description":"Минск, Беларусь","name":"улица Ленина, 19","boundedBy":{"Envelope":{"lowerCorner":"27.561418 53.897","upperCorner":"27.565514 53.899419"}},"Point":{"pos":"27.563466 53.898209"}}}]}}}"; \ No newline at end of file +s:960:"{"response":{"Attribution":"","GeoObjectCollection":{"metaDataProperty":{"GeocoderResponseMetaData":{"request":"ул.Ленина, 19, Минск 220030, Республика Беларусь","found":"1","results":"5"}},"featureMember":[{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Беларусь, Минск, улица Ленина, 19","precision":"exact","AddressDetails":{"Country":{"AddressLine":"Минск, улица Ленина, 19","CountryNameCode":"BY","CountryName":"Беларусь","AdministrativeArea":{"AdministrativeAreaName":"Минск","Locality":{"LocalityName":"Минск","Thoroughfare":{"ThoroughfareName":"улица Ленина","Premise":{"PremiseNumber":"19"}}}}}}}},"description":"Минск, Беларусь","name":"улица Ленина, 19","boundedBy":{"Envelope":{"lowerCorner":"27.555237 53.893349","upperCorner":"27.571695 53.903069"}},"Point":{"pos":"27.563466 53.898209"}}}]}}}"; \ No newline at end of file diff --git a/tests/.cached_responses/6c34e56e6e09ba3fb9fe3000ff7a290db6f3d9f8 b/tests/.cached_responses/6c34e56e6e09ba3fb9fe3000ff7a290db6f3d9f8 deleted file mode 100644 index 5aa26822a..000000000 --- a/tests/.cached_responses/6c34e56e6e09ba3fb9fe3000ff7a290db6f3d9f8 +++ /dev/null @@ -1,226 +0,0 @@ -s:6642:"{ - "licenses" : [ - { - "name" : "CC-BY-SA", - "url" : "http://creativecommons.org/licenses/by-sa/3.0/" - }, - { - "name" : "ODbL", - "url" : "http://opendatacommons.org/licenses/odbl/summary/" - } - ], - "rate" : { - "limit" : 2500, - "remaining" : 2444, - "reset" : 1410393600 - }, - "results" : [ - { - "annotations" : { - "OSGB" : { - "easting" : 529926.637, - "gridref" : "TQ 299 804", - "northing" : 180425.581 - }, - "OSM" : { - "url" : "http://www.openstreetmap.org/?mlat=51.50732&mlon=-0.12765#map=17/51.50732/-0.12765" - }, - "geohash" : "gcpvj0e5csepnkstrhwy", - "timezone" : { - "name" : "Europe/London", - "now_in_dst" : 1, - "offset_sec" : 3600, - "offset_string" : 100, - "short_name" : "BST" - } - }, - "bounds" : { - "northeast" : { - "lat" : 51.6918741, - "lng" : 0.3340155 - }, - "southwest" : { - "lat" : 51.2867602, - "lng" : -0.510375 - } - }, - "components" : { - "city" : "Londres", - "country" : "Reino Unido", - "country_code" : "gb", - "county" : "Londres", - "state" : "Inglaterra", - "state_district" : "Greater London" - }, - "confidence" : 1, - "formatted" : "Londres, Reino Unido", - "geometry" : { - "lat" : 51.5073219, - "lng" : -0.1276474 - } - }, - { - "annotations" : { - "OSM" : { - "url" : "http://www.openstreetmap.org/?mlat=42.98810&mlon=-81.24603#map=17/42.98810/-81.24603" - }, - "geohash" : "dpwhx1wry61e0k07ppd4", - "timezone" : { - "name" : "America/Toronto", - "now_in_dst" : 1, - "offset_sec" : -14400, - "offset_string" : -400, - "short_name" : "EDT" - } - }, - "bounds" : { - "northeast" : { - "lat" : 43.148097, - "lng" : -81.0860295 - }, - "southwest" : { - "lat" : 42.828097, - "lng" : -81.4060295 - } - }, - "components" : { - "city" : "London", - "country" : "Canad\u00e1", - "country_code" : "CA", - "state" : "Ontario" - }, - "confidence" : 3, - "formatted" : "London, Ontario, Canad\u00e1", - "geometry" : { - "lat" : 42.988097, - "lng" : -81.2460295 - } - }, - { - "annotations" : { - "OSM" : { - "url" : "http://www.openstreetmap.org/?mlat=37.12898&mlon=-84.08326#map=17/37.12898/-84.08326" - }, - "geohash" : "dns5nxh7vyvxtbc60qcu", - "timezone" : { - "name" : "America/New_York", - "now_in_dst" : 1, - "offset_sec" : -14400, - "offset_string" : -400, - "short_name" : "EDT" - } - }, - "bounds" : { - "northeast" : { - "lat" : 37.15226, - "lng" : -84.0359569 - }, - "southwest" : { - "lat" : 37.079759, - "lng" : -84.1262619 - } - }, - "components" : { - "city" : "London", - "country" : "Estados Unidos de Am\u00e9rica", - "country_code" : "US", - "county" : "Laurel County", - "state" : "Kentucky" - }, - "confidence" : 7, - "formatted" : "London, Laurel County, Kentucky, Estados Unidos de Am\u00e9rica", - "geometry" : { - "lat" : 37.1289771, - "lng" : -84.0832646 - } - }, - { - "annotations" : { - "OSM" : { - "url" : "http://www.openstreetmap.org/?mlat=43.04778&mlon=-89.01289#map=17/43.04778/-89.01289" - }, - "geohash" : "dp8sykwg3r7gpmsn4b9x", - "timezone" : { - "name" : "America/Chicago", - "now_in_dst" : 1, - "offset_sec" : -18000, - "offset_string" : -500, - "short_name" : "CDT" - } - }, - "bounds" : { - "northeast" : { - "lat" : 43.0677775, - "lng" : -88.9928881 - }, - "southwest" : { - "lat" : 43.0277775, - "lng" : -89.0328881 - } - }, - "components" : { - "country" : "Estados Unidos de Am\u00e9rica", - "country_code" : "US", - "county" : "Dane County", - "hamlet" : "London", - "state" : "Wisconsin" - }, - "confidence" : 7, - "formatted" : "London, Dane County, Wisconsin, Estados Unidos de Am\u00e9rica", - "geometry" : { - "lat" : 43.0477775, - "lng" : -89.0128881 - } - }, - { - "annotations" : { - "OSM" : { - "url" : "http://www.openstreetmap.org/?mlat=39.88645&mlon=-83.44825#map=17/39.88645/-83.44825" - }, - "geohash" : "dphdvj4g6v09uv0q3rxk", - "timezone" : { - "name" : "America/New_York", - "now_in_dst" : 1, - "offset_sec" : -14400, - "offset_string" : -400, - "short_name" : "EDT" - } - }, - "bounds" : { - "northeast" : { - "lat" : 39.921786, - "lng" : -83.3899969 - }, - "southwest" : { - "lat" : 39.85928, - "lng" : -83.4789229 - } - }, - "components" : { - "city" : "London", - "country" : "Estados Unidos de Am\u00e9rica", - "country_code" : "US", - "county" : "Madison County", - "state" : "Ohio" - }, - "confidence" : 7, - "formatted" : "London, Madison County, Ohio, Estados Unidos de Am\u00e9rica", - "geometry" : { - "lat" : 39.8864493, - "lng" : -83.448253 - } - } - ], - "status" : { - "code" : 200, - "message" : "OK" - }, - "thanks" : "For using an OpenCage Data API", - "timestamp" : { - "created_http" : "Wed, 10 Sep 2014 22:32:58 GMT", - "created_unix" : 1410388378 - }, - "total_results" : 5, - "we_are_hiring" : "http://lokku.com/#jobs" -} -"; \ No newline at end of file diff --git a/tests/.cached_responses/6c631da4e9548c0b1e68c16f80cdfe51f0fa4e06 b/tests/.cached_responses/6c631da4e9548c0b1e68c16f80cdfe51f0fa4e06 deleted file mode 100644 index 362bd8188..000000000 --- a/tests/.cached_responses/6c631da4e9548c0b1e68c16f80cdfe51f0fa4e06 +++ /dev/null @@ -1 +0,0 @@ -s:1992:"55.70438912.546129u3buvkxv9fxzTomTomMap422poi7311Uno-X0Uno-X0180.0TagensvejCopenhagenDenmarkDNK2200Uno-X, Tagensvej 422, 2200, Copenhagen, DNKfalse111.01.00"; \ No newline at end of file diff --git a/tests/.cached_responses/7b6ca05d2ae5285a113067a9967f856723b3b99e b/tests/.cached_responses/6c6fa0f2c6632ec68d3d240ea0c17713093a32f7 similarity index 100% rename from tests/.cached_responses/7b6ca05d2ae5285a113067a9967f856723b3b99e rename to tests/.cached_responses/6c6fa0f2c6632ec68d3d240ea0c17713093a32f7 diff --git a/tests/.cached_responses/6e0f46692b3ef7e83b4e947928c3e5b4fb5e4248 b/tests/.cached_responses/6e0f46692b3ef7e83b4e947928c3e5b4fb5e4248 new file mode 100644 index 000000000..709c61095 --- /dev/null +++ b/tests/.cached_responses/6e0f46692b3ef7e83b4e947928c3e5b4fb5e4248 @@ -0,0 +1 @@ +s:1995:"55.70438912.546129u3buvkxv9fxzTomTomMap422poi7311Uno-X0Uno-X0180.0TagensvejCopenhagueDanemarkDNK2200Uno-X, Tagensvej 422, 2200, Copenhague, DNKfalse111.01.00"; \ No newline at end of file diff --git a/tests/.cached_responses/6f34a1eb48a97017a08e289b88e103eabd9581e9 b/tests/.cached_responses/6f34a1eb48a97017a08e289b88e103eabd9581e9 deleted file mode 100644 index 1dfb50d3d..000000000 --- a/tests/.cached_responses/6f34a1eb48a97017a08e289b88e103eabd9581e9 +++ /dev/null @@ -1 +0,0 @@ -s:187:"US,"United States",UT,Utah,Provo,40.2181,-111.6133,770,801,America/Denver,NA,84606,"Unified Layer","Unified Layer",bluehost.com,"AS46606 Unified Layer",Corporate,business,999,90,17,17,10,"; \ No newline at end of file diff --git a/tests/.cached_responses/6fee0a856bf599a641fc9edf71b3f0c8f80403d5 b/tests/.cached_responses/6fee0a856bf599a641fc9edf71b3f0c8f80403d5 deleted file mode 100644 index b23bc0c63..000000000 --- a/tests/.cached_responses/6fee0a856bf599a641fc9edf71b3f0c8f80403d5 +++ /dev/null @@ -1,16 +0,0 @@ -s:414:"{ - "2543 Graystone Place, Simi Valley, CA 93065": { - "country_code3": "USA", - "latitude": 34.280874, - "country_name": "United States", - "longitude": -118.766282, - "street_address": "2543 Graystone Pl", - "region": "CA", - "confidence": 1.0, - "street_number": "2543", - "locality": "Simi Valley", - "street_name": "Graystone Pl", - "fips_county": "06111", - "country_code": "US" - } -}"; \ No newline at end of file diff --git a/tests/.cached_responses/44a67d2e565f1ac9d0c2e32cb6d8fe68e9c169ca b/tests/.cached_responses/72a69855f28b41522dde9af4db6245333617ca27 similarity index 85% rename from tests/.cached_responses/44a67d2e565f1ac9d0c2e32cb6d8fe68e9c169ca rename to tests/.cached_responses/72a69855f28b41522dde9af4db6245333617ca27 index da7ba6ef2..59dddda15 100644 --- a/tests/.cached_responses/44a67d2e565f1ac9d0c2e32cb6d8fe68e9c169ca +++ b/tests/.cached_responses/72a69855f28b41522dde9af4db6245333617ca27 @@ -1 +1 @@ -s:1271:"{"authenticationResultCode":"ValidCredentials","brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png","copyright":"Copyright © 2014 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","resourceSets":[{"estimatedTotal":1,"resources":[{"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1","bbox":[48.859353282429325,2.3809437367578012,48.867078717570678,2.3966002632421985],"name":"10 Avenue Gambetta, 75020 Paris","point":{"type":"Point","coordinates":[48.863216,2.388772]},"address":{"addressLine":"10 Avenue Gambetta","adminDistrict":"IdF","adminDistrict2":"Paris","countryRegion":"France","formattedAddress":"10 Avenue Gambetta, 75020 Paris","locality":"Paris","postalCode":"75020"},"confidence":"Medium","entityType":"Address","geocodePoints":[{"type":"Point","coordinates":[48.863216,2.388772],"calculationMethod":"Interpolation","usageTypes":["Display","Route"]}],"matchCodes":["Good"]}]}],"statusCode":200,"statusDescription":"OK","traceId":"592f2adab6af4f6795574bc472ae49ea|DB40170257|02.00.108.1000|DB4SCH010061059, DB4SCH010061351"}"; \ No newline at end of file +s:1271:"{"authenticationResultCode":"ValidCredentials","brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png","copyright":"Copyright © 2015 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","resourceSets":[{"estimatedTotal":1,"resources":[{"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1","bbox":[48.859353282429325,2.3809437367578012,48.867078717570678,2.3966002632421985],"name":"10 Avenue Gambetta, 75020 Paris","point":{"type":"Point","coordinates":[48.863216,2.388772]},"address":{"addressLine":"10 Avenue Gambetta","adminDistrict":"IdF","adminDistrict2":"Paris","countryRegion":"France","formattedAddress":"10 Avenue Gambetta, 75020 Paris","locality":"Paris","postalCode":"75020"},"confidence":"Medium","entityType":"Address","geocodePoints":[{"type":"Point","coordinates":[48.863216,2.388772],"calculationMethod":"Interpolation","usageTypes":["Display","Route"]}],"matchCodes":["Good"]}]}],"statusCode":200,"statusDescription":"OK","traceId":"7bba06735b15417d864ae93a02705ab8|DB40180163|02.00.119.2100|DB4SCH010031557, DB4SCH010061359"}"; \ No newline at end of file diff --git a/tests/.cached_responses/753d61c7c991002e790dd6f22f6914486945180c b/tests/.cached_responses/753d61c7c991002e790dd6f22f6914486945180c deleted file mode 100644 index aaecb8167..000000000 --- a/tests/.cached_responses/753d61c7c991002e790dd6f22f6914486945180c +++ /dev/null @@ -1 +0,0 @@ -s:565:"56.5243510.06744StabelsvejSpentrupDenmarkDNKStabelsvej 16, Spentrup, DKS56.5402710.0309416"; \ No newline at end of file diff --git a/tests/.cached_responses/786e1f4aed741c35447d26408ed53ec2e3cc1998 b/tests/.cached_responses/786e1f4aed741c35447d26408ed53ec2e3cc1998 index fc091f386..1669c1ab2 100644 --- a/tests/.cached_responses/786e1f4aed741c35447d26408ed53ec2e3cc1998 +++ b/tests/.cached_responses/786e1f4aed741c35447d26408ed53ec2e3cc1998 @@ -1,3 +1,3 @@ -s:1052:" - -Bistrot Beaubourg, 25, Rue Quincampoix, Beaubourg, Quartier Saint-Merri, 4e Arrondissement, Paris, Île-de-France, 75004, France, European UnionBistrot Beaubourg25Rue QuincampoixBeaubourgQuartier Saint-Merri4e ArrondissementParisParisÎle-de-France75004FrancefrEuropean Union"; \ No newline at end of file +s:1020:" + +Bistrot Beaubourg, 25, Rue Quincampoix, Beaubourg, Quartier Saint-Merri, 4e Arrondissement, Paris, Île-de-France, France métropolitaine, 75004, FranceBistrot Beaubourg25Rue QuincampoixBeaubourgQuartier Saint-Merri4e ArrondissementParisParisÎle-de-FranceFrance75004fr"; \ No newline at end of file diff --git a/tests/.cached_responses/7935ce6e64b9430cb55c248f598759370367b0dc b/tests/.cached_responses/7935ce6e64b9430cb55c248f598759370367b0dc deleted file mode 100644 index b6fa2678b..000000000 --- a/tests/.cached_responses/7935ce6e64b9430cb55c248f598759370367b0dc +++ /dev/null @@ -1,9 +0,0 @@ -s:252:" - - 38.898748 - -77.037684 - - -1600Pennsylvania AveWASHINGTONDC - -"; \ No newline at end of file diff --git a/tests/.cached_responses/79bff4e0349cf851754db4dd986e18242ca84428 b/tests/.cached_responses/79bff4e0349cf851754db4dd986e18242ca84428 new file mode 100644 index 000000000..5929c3d84 --- /dev/null +++ b/tests/.cached_responses/79bff4e0349cf851754db4dd986e18242ca84428 @@ -0,0 +1 @@ +s:14132:"{"totalResultsCount":5981,"geonames":[{"timezone":{"gmtOffset":0,"timeZoneId":"Europe/London","dstOffset":1},"bbox":{"east":0.45212493672385795,"south":51.15168939834484,"north":51.865368153380956,"west":-0.7036088539601859},"asciiName":"London","countryId":"2635167","fcl":"P","score":130.2335968017578,"adminId2":"2648110","countryCode":"GB","adminId1":"6269131","lat":"51.50853","fcode":"PPLC","continentCode":"EU","adminCode2":"GLA","adminCode1":"ENG","lng":"-0.12574","geonameId":2643743,"toponymName":"London","population":7556900,"adminName5":"","adminName4":"","adminName3":"","alternateNames":[{"name":"Лондан","lang":"ab"},{"name":"Londen","lang":"af"},{"name":"London","lang":"als"},{"name":"ለንደን","lang":"am"},{"name":"Londres","lang":"an"},{"name":"Lunden","lang":"ang"},{"name":"لندن","lang":"ar"},{"name":"ܠܘܢܕܘܢ","lang":"arc"},{"name":"لندن","lang":"arz"},{"name":"Londres","lang":"ast"},{"name":"London","lang":"az"},{"name":"Лондон","lang":"ba"},{"name":"Londres","lang":"bcl"},{"name":"Лёндан","lang":"be"},{"name":"Лондон","lang":"bg"},{"name":"লন্ডন","lang":"bn"},{"name":"ལོན་ཊོན།","lang":"bo"},{"name":"Londrez","lang":"br"},{"name":"London","lang":"bs"},{"name":"Londres","lang":"ca"},{"name":"Lùng-dŭng","lang":"cdo"},{"name":"ᎫᎴ ᏗᏍᎪᏂᎯᏱ","lang":"chr"},{"name":"لەندەن","lang":"ckb"},{"name":"Londra","lang":"co"},{"name":"Londýn","lang":"cs"},{"name":"Лондонъ","lang":"cu"},{"name":"Лондон","lang":"cv"},{"name":"Llundain","lang":"cy"},{"name":"London","lang":"da"},{"name":"London","lang":"de"},{"name":"Londra","lang":"diq"},{"name":"Λονδίνο","lang":"el"},{"name":"London","lang":"en"},{"name":"Londono","lang":"eo"},{"name":"Londres","lang":"es"},{"name":"London","lang":"et"},{"name":"Londres","lang":"eu"},{"name":"Londri","lang":"ext"},{"name":"لندن","lang":"fa"},{"name":"Lontoo","lang":"fi"},{"name":"Londres","lang":"fr"},{"name":"Londres","lang":"frp"},{"name":"Londen","lang":"fy"},{"name":"Londain","lang":"ga"},{"name":"倫敦","lang":"gan"},{"name":"Lunnainn","lang":"gd"},{"name":"Londres","lang":"gl"},{"name":"Londye","lang":"gn"},{"name":"લંડન","lang":"gu"},{"name":"Lunnin","lang":"gv"},{"name":"Lākana","lang":"haw"},{"name":"London","lang":"hbs"},{"name":"לונדון","lang":"he"},{"name":"लंदन","lang":"hi"},{"name":"London","lang":"hr"},{"name":"Lonn","lang":"ht"},{"name":"London","lang":"hu"},{"name":"Լոնդոն","lang":"hy"},{"name":"London","lang":"ia"},{"name":"LON","lang":"iata"},{"name":"London","lang":"id"},{"name":"Londres","lang":"ilo"},{"name":"London","lang":"io"},{"name":"London","lang":"is"},{"name":"Londra","lang":"it"},{"name":"ロンドン","lang":"ja"},{"name":"london","lang":"jbo"},{"name":"ლონდონი","lang":"ka"},{"name":"Лондон","lang":"kk"},{"name":"ಲಂಡನ್","lang":"kn"},{"name":"런던","lang":"ko"},{"name":"Лондон","lang":"koi"},{"name":"Лондон","lang":"krc"},{"name":"London","lang":"ku"},{"name":"Лондон","lang":"kv"},{"name":"Loundres","lang":"kw"},{"name":"Лондон","lang":"ky"},{"name":"Londinium","lang":"la"},{"name":"Londra","lang":"lad"},{"name":"London","lang":"lb"},{"name":"Лондон","lang":"lbe"},{"name":"Лондон","lang":"lez"},{"name":"Londe","lang":"li"},{"name":"Londra","lang":"lij"},{"name":"http://en.wikipedia.org/wiki/London","lang":"link"},{"name":"Lundra","lang":"lmo"},{"name":"Londoni","lang":"ln"},{"name":"ລອນດອນ","lang":"lo"},{"name":"Londonas","lang":"lt"},{"name":"Londona","lang":"lv"},{"name":"Лондон","lang":"mhr"},{"name":"Rānana","lang":"mi"},{"name":"Лондон","lang":"mk"},{"name":"ലണ്ടൻ","lang":"ml"},{"name":"Лондон","lang":"mn"},{"name":"लंडन","lang":"mr"},{"name":"Лондон","lang":"mrj"},{"name":"London","lang":"ms"},{"name":"Londra","lang":"mt"},{"name":"Londres","lang":"mwl"},{"name":"လန်ဒန်မြို့","lang":"my"},{"name":"لندن","lang":"mzn"},{"name":"Londres","lang":"nah"},{"name":"Londra","lang":"nap"},{"name":"London","lang":"nds"},{"name":"लण्डन","lang":"ne"},{"name":"लण्डन","lang":"new"},{"name":"Londen","lang":"nl"},{"name":"London","lang":"nn"},{"name":"London","lang":"no"},{"name":"Londres","lang":"nrm"},{"name":"Londres","lang":"oc"},{"name":"ଲଣ୍ଡନ","lang":"or"},{"name":"Лондон","lang":"os"},{"name":"Londe","lang":"pcd"},{"name":"Londyn","lang":"pl"},{"name":"Londra","lang":"pms"},{"name":"لندن","lang":"pnb"},{"name":"Λονδίνο","lang":"pnt"},{"name":"لندن","lang":"ps"},{"name":"Londres","lang":"pt"},{"name":"London","lang":"qu"},{"name":"Londra","lang":"rm"},{"name":"Londra","lang":"ro"},{"name":"Лондон","lang":"ru"},{"name":"Лондон","lang":"rue"},{"name":"लन्डन्","lang":"sa"},{"name":"Лондон","lang":"sah"},{"name":"Londra","lang":"sc"},{"name":"Londra","lang":"scn"},{"name":"Lunnon","lang":"sco"},{"name":"ලන්ඩන්","lang":"si"},{"name":"Londýn","lang":"sk"},{"name":"London","lang":"sl"},{"name":"Londra","lang":"sq"},{"name":"Лондон","lang":"sr"},{"name":"London","lang":"sv"},{"name":"Lůndůn","lang":"szl"},{"name":"இலண்டன்","lang":"ta"},{"name":"లండన్","lang":"te"},{"name":"Londres","lang":"tet"},{"name":"Лондон","lang":"tg"},{"name":"ลอนดอน","lang":"th"},{"name":"Londres","lang":"tl"},{"name":"Landen","lang":"tpi"},{"name":"Londra","lang":"tr"},{"name":"Лондон","lang":"tt"},{"name":"Лондон","lang":"udm"},{"name":"لوندون","lang":"ug"},{"name":"Лондон","lang":"uk"},{"name":"LON","lang":"unlc"},{"name":"لندن","lang":"ur"},{"name":"Łondra","lang":"vec"},{"name":"Luân Đôn","lang":"vi"},{"name":"Londn","lang":"vls"},{"name":"London","lang":"vo"},{"name":"Londar","lang":"wo"},{"name":"伦敦","lang":"wuu"},{"name":"ლონდონი","lang":"xmf"},{"name":"לאנדאן","lang":"yi"},{"name":"Lọndọnu","lang":"yo"},{"name":"Londen","lang":"zea"},{"name":"伦敦","lang":"zh"},{"name":"伦敦","lang":"zh-CN"},{"name":"ILondon","lang":"zu"}],"adminName2":"Greater London","name":"Londra","fclName":"city, village,...","countryName":"Regno Unito","fcodeName":"capital of a political entity","adminName1":"Inghilterra"},{"timezone":{"gmtOffset":2,"timeZoneId":"Africa/Johannesburg","dstOffset":2},"bbox":{"east":28.018503381239466,"south":-33.10499645800343,"north":-32.92557372892517,"west":27.804746435655137},"asciiName":"East London","countryId":"953987","fcl":"P","score":51.99159240722656,"cc2":"ZA","adminId2":"8347340","adminId3":"8347472","countryCode":"ZA","adminId1":"1085593","lat":"-33.01529","fcode":"PPLA2","continentCode":"AF","adminCode2":"BUF","adminCode3":"BUF","adminCode1":"05","lng":"27.91162","geonameId":1006984,"toponymName":"East London","population":478676,"adminName5":"","adminName4":"","adminName3":"Buffalo City","alternateNames":[{"name":"Oos Londen","lang":"af"},{"name":"Горад Іст-Лондан","lang":"be"},{"name":"Източен Лондон","lang":"bg"},{"name":"East London","lang":"da"},{"name":"East London","lang":"en"},{"name":"Orient-Londono","lang":"eo"},{"name":"East London","lang":"fi"},{"name":"East London","lang":"fr"},{"name":"Tûng Lùn-tûn","lang":"hak"},{"name":"איסט לונדון","lang":"he"},{"name":"ELS","lang":"iata"},{"name":"East London","lang":"id"},{"name":"イースト・ロンドン","lang":"ja"},{"name":"이스트런던","lang":"ko"},{"name":"Londinium Orientale","lang":"la"},{"name":"http://en.wikipedia.org/wiki/East_London%2C_Eastern_Cape","lang":"link"},{"name":"Yst Londonas","lang":"lt"},{"name":"ईस्ट लंडन","lang":"mr"},{"name":"Oost-Londen","lang":"nl"},{"name":"East London","lang":"pl"},{"name":"ایسٹ لندن","lang":"pnb"},{"name":"Ист-Лондон","lang":"ru"},{"name":"Источни Лондон","lang":"sr"},{"name":"Іст-Лондон","lang":"uk"},{"name":"ELS","lang":"unlc"},{"name":"東倫敦","lang":"zh"}],"adminName2":"Buffalo City Metropolitan Municipality","name":"East London","fclName":"city, village,...","countryName":"Sudafrica","fcodeName":"seat of a second-order administrative division","adminName1":"Eastern Cape"},{"timezone":{"gmtOffset":0,"timeZoneId":"Europe/London","dstOffset":1},"bbox":{"east":0.48608279418977673,"south":51.15594951276414,"north":51.86962826782626,"west":-0.6697604675296205},"asciiName":"City of London","countryId":"2635167","fcl":"P","score":48.792354583740234,"adminId2":"2648110","adminId3":"2643744","countryCode":"GB","adminId1":"6269131","lat":"51.51279","fcode":"PPLA3","continentCode":"EU","adminCode2":"GLA","adminCode3":"H9","adminCode1":"ENG","lng":"-0.09184","geonameId":2643741,"toponymName":"City of London","population":7556900,"adminName5":"","adminName4":"","adminName3":"City of London","alternateNames":[{"name":"Lundenceaster","lang":"ang"},{"name":"مدينة لندن","lang":"ar"},{"name":"Сіці","lang":"be"},{"name":"Сити","lang":"bg"},{"name":"Kêr Londrez","lang":"br"},{"name":"La City","lang":"ca"},{"name":"Dakbayan sa Londres","lang":"ceb"},{"name":"City","lang":"cs"},{"name":"Dinas Llundain","lang":"cy"},{"name":"Σίτι του Λονδίνου","lang":"el"},{"name":"City","lang":"eo"},{"name":"City de Londres","lang":"es"},{"name":"سیتی لندن","lang":"fa"},{"name":"Lontoon City","lang":"fi"},{"name":"Cité de Londres","lang":"fr"},{"name":"Cathair Londan","lang":"ga"},{"name":"Cidade de Londres","lang":"gl"},{"name":"הסיטי של לונדון","lang":"he"},{"name":"सिटी ऑफ़ लंदन","lang":"hi"},{"name":"Լոնդոնյան Սիթի","lang":"hy"},{"name":"Lundúnaborg","lang":"is"},{"name":"Città di Londra","lang":"it"},{"name":"シティ・オブ・ロンドン","lang":"ja"},{"name":"시티오브런던","lang":"ko"},{"name":"Urbs Londiniensis","lang":"la"},{"name":"http://en.wikipedia.org/wiki/City_of_London","lang":"link"},{"name":"Londono Sitis","lang":"lt"},{"name":"Londonas Sitija","lang":"lv"},{"name":"सिटी ऑफ लंडन","lang":"mr"},{"name":"Bandaraya London","lang":"ms"},{"name":"Cidade de Londres","lang":"mwl"},{"name":"Lûn-tun Chhī","lang":"nan"},{"name":"لندن شہر","lang":"pnb"},{"name":"Cidade de Londres","lang":"pt"},{"name":"Сити","lang":"ru"},{"name":"Ceety o Lunnon","lang":"sco"},{"name":"Сити","lang":"sr"},{"name":"นครลอนดอน","lang":"th"},{"name":"Lungsod ng Londres","lang":"tl"},{"name":"Londra Şehri","lang":"tr"},{"name":"Лондонське Сіті","lang":"uk"},{"name":"Thành phố Luân Đôn","lang":"vi"},{"name":"London","lang":"war"},{"name":"סיטי פון לאנדאן","lang":"yi"},{"name":"倫敦市","lang":"zh"},{"name":"Idolobha weLondon","lang":"zu"}],"adminName2":"Greater London","name":"Città di Londra","fclName":"city, village,...","countryName":"Regno Unito","fcodeName":"seat of a third-order administrative division","adminName1":"Inghilterra"},{"timezone":{"gmtOffset":-5,"timeZoneId":"America/Toronto","dstOffset":-4},"bbox":{"east":-81.12859509753737,"south":42.907075642763076,"north":43.05970292323693,"west":-81.33748967646262},"asciiName":"London","countryId":"6251999","fcl":"P","score":44.582420349121094,"countryCode":"CA","adminId1":"6093943","lat":"42.98339","fcode":"PPL","continentCode":"NA","adminCode1":"08","lng":"-81.23304","geonameId":6058560,"toponymName":"London","population":346765,"adminName5":"","adminName4":"","adminName3":"","alternateNames":[{"name":"لندن، أونتاريو","lang":"ar"},{"name":"Лондон","lang":"bg"},{"name":"London","lang":"de"},{"name":"London","lang":"en"},{"name":"Londono","lang":"eo"},{"name":"London","lang":"es"},{"name":"London","lang":"et"},{"name":"لندن، انتاریو","lang":"fa"},{"name":"London","lang":"fi"},{"name":"London","lang":"fr"},{"name":"לונדון","lang":"he"},{"name":"YXU","lang":"iata"},{"name":"ロンドン","lang":"ja"},{"name":"ლონდონი","lang":"ka"},{"name":"런던","lang":"ko"},{"name":"http://en.wikipedia.org/wiki/London%2C_Ontario","lang":"link"},{"name":"Londonas","lang":"lt"},{"name":"London","lang":"nl"},{"name":"Лондон","lang":"os"},{"name":"London","lang":"pl"},{"name":"لندن","lang":"pnb"},{"name":"London","lang":"pt"},{"name":"Лондон","lang":"ru"},{"name":"Лондон","lang":"sr"},{"name":"Лондон","lang":"uk"},{"name":"LOD","lang":"unlc"},{"name":"لندن، اونٹاریو","lang":"ur"},{"name":"伦敦","lang":"zh"},{"name":"伦敦","lang":"zh-CN"}],"adminName2":"","name":"London","fclName":"city, village,...","countryName":"Canada","fcodeName":"populated place","adminName1":"Ontario"},{"timezone":{"gmtOffset":-5,"timeZoneId":"America/New_York","dstOffset":-4},"bbox":{"east":-72.07078054515445,"south":41.334087887904154,"north":41.377219912095846,"west":-72.12826125484555},"asciiName":"New London","countryId":"6252001","fcl":"P","score":32.148841857910156,"adminId2":"4839420","countryCode":"US","adminId1":"4831725","lat":"41.35565","fcode":"PPL","continentCode":"NA","elevation":17,"adminCode2":"011","adminCode1":"CT","lng":"-72.09952","geonameId":4839416,"toponymName":"New London","population":27620,"adminName5":"","adminName4":"","adminName3":"","alternateNames":[{"name":"Ню Лъндън","lang":"bg"},{"name":"Nova Londres","lang":"ca"},{"name":"Llundain Newydd","lang":"cy"},{"name":"ニューロンドン","lang":"ja"},{"name":"Нью Лондон","lang":"kk"},{"name":"뉴런던","lang":"ko"},{"name":"http://en.wikipedia.org/wiki/New_London%2C_Connecticut","lang":"link"},{"name":"न्यू लंडन","lang":"mr"},{"name":"न्यु लंडन","lang":"new"},{"name":"06320","lang":"post"},{"name":"Нью-Лондон","lang":"ru"},{"name":"Њу Лондон","lang":"sr"},{"name":"Нью-Лондон","lang":"uk"},{"name":"NLO","lang":"unlc"},{"name":"新伦敦","lang":"zh"}],"adminName2":"Contea di New London","name":"New London","fclName":"city, village,...","countryName":"Stati Uniti","fcodeName":"populated place","adminName1":"Connecticut"}]}"; \ No newline at end of file diff --git a/tests/.cached_responses/806c75f6fe97faa322b1431647bd475f581878fc b/tests/.cached_responses/806c75f6fe97faa322b1431647bd475f581878fc index 1ce8e5ba9..7b0e16918 100644 --- a/tests/.cached_responses/806c75f6fe97faa322b1431647bd475f581878fc +++ b/tests/.cached_responses/806c75f6fe97faa322b1431647bd475f581878fc @@ -1,5 +1,5 @@ -s:1829:" - - -Allée Évariste GaloisLa PardieuClermont-FerrandClermont-FerrandAuvergne63170FrancefrEuropean Union -Allée Évariste GaloisCap SudAubièreClermont-FerrandAuvergne63170FrancefrEuropean Union"; \ No newline at end of file +s:1734:" + + +Allée Évariste GaloisLa PardieuClermont-FerrandClermont-FerrandAuvergneFrance63000;63100fr +Allée Évariste GaloisCap SudAubièreClermont-FerrandAuvergneFrance63170fr"; \ No newline at end of file diff --git a/tests/.cached_responses/867454f52ff07ab403df7cb308d961e25e54dea3 b/tests/.cached_responses/867454f52ff07ab403df7cb308d961e25e54dea3 index c6957fd64..402faa7e0 100644 --- a/tests/.cached_responses/867454f52ff07ab403df7cb308d961e25e54dea3 +++ b/tests/.cached_responses/867454f52ff07ab403df7cb308d961e25e54dea3 @@ -1 +1 @@ -s:3988:"{"response":{"Attribution":"","GeoObjectCollection":{"metaDataProperty":{"GeocoderResponseMetaData":{"request":"10 avenue Gambetta, Paris, France","found":"154","results":"5"}},"featureMember":[{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Франция, Иль-Де-Франс, Avenue Gambetta, 10","precision":"exact","AddressDetails":{"Country":{"AddressLine":"Иль-Де-Франс, Avenue Gambetta, 10","CountryNameCode":"FR","CountryName":"Франция","AdministrativeArea":{"AdministrativeAreaName":"Иль-Де-Франс","Locality":{"Thoroughfare":{"ThoroughfareName":"Avenue Gambetta","Premise":{"PremiseNumber":"10"}}}}}}}},"description":"Иль-Де-Франс, Франция","name":"Avenue Gambetta, 10","boundedBy":{"Envelope":{"lowerCorner":"2.386967 48.861926","upperCorner":"2.391064 48.864629"}},"Point":{"pos":"2.389016 48.863277"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Франция, Вал-де-Марн, Мезон-Альфор, Avenue Gambetta, 10","precision":"exact","AddressDetails":{"Country":{"AddressLine":"Вал-де-Марн, Мезон-Альфор, Avenue Gambetta, 10","CountryNameCode":"FR","CountryName":"Франция","AdministrativeArea":{"AdministrativeAreaName":"Вал-де-Марн","Locality":{"LocalityName":"Мезон-Альфор","Thoroughfare":{"ThoroughfareName":"Avenue Gambetta","Premise":{"PremiseNumber":"10"}}}}}}}},"description":"Мезон-Альфор, Вал-де-Марн, Франция","name":"Avenue Gambetta, 10","boundedBy":{"Envelope":{"lowerCorner":"2.433877 48.808786","upperCorner":"2.437974 48.811491"}},"Point":{"pos":"2.435926 48.810138"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Франция, О-де-Сен, Курбевуа, Avenue Gambetta, 2","precision":"near","AddressDetails":{"Country":{"AddressLine":"О-де-Сен, Курбевуа, Avenue Gambetta, 2","CountryNameCode":"FR","CountryName":"Франция","AdministrativeArea":{"AdministrativeAreaName":"О-де-Сен","Locality":{"LocalityName":"Курбевуа","Thoroughfare":{"ThoroughfareName":"Avenue Gambetta","Premise":{"PremiseNumber":"2"}}}}}}}},"description":"Курбевуа, О-де-Сен, Франция","name":"Avenue Gambetta, 2","boundedBy":{"Envelope":{"lowerCorner":"2.244126 48.891422","upperCorner":"2.248223 48.894123"}},"Point":{"pos":"2.246174 48.892773"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Франция, Вал-де-Марн, Сен-Мандэ, Avenue Gambetta, 9","precision":"near","AddressDetails":{"Country":{"AddressLine":"Вал-де-Марн, Сен-Мандэ, Avenue Gambetta, 9","CountryNameCode":"FR","CountryName":"Франция","AdministrativeArea":{"AdministrativeAreaName":"Вал-де-Марн","Locality":{"LocalityName":"Сен-Мандэ","Thoroughfare":{"ThoroughfareName":"Avenue Gambetta","Premise":{"PremiseNumber":"9"}}}}}}}},"description":"Сен-Мандэ, Вал-де-Марн, Франция","name":"Avenue Gambetta, 9","boundedBy":{"Envelope":{"lowerCorner":"2.418444 48.843288","upperCorner":"2.422541 48.845992"}},"Point":{"pos":"2.420493 48.844640"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Франция, О-де-Сен, Монруж, Avenue Léon Gambetta, 10","precision":"exact","AddressDetails":{"Country":{"AddressLine":"О-де-Сен, Монруж, Avenue Léon Gambetta, 10","CountryNameCode":"FR","CountryName":"Франция","AdministrativeArea":{"AdministrativeAreaName":"О-де-Сен","Locality":{"LocalityName":"Монруж","Thoroughfare":{"ThoroughfareName":"Avenue Léon Gambetta","Premise":{"PremiseNumber":"10"}}}}}}}},"description":"Монруж, О-де-Сен, Франция","name":"Avenue Léon Gambetta, 10","boundedBy":{"Envelope":{"lowerCorner":"2.322594 48.812167","upperCorner":"2.32669 48.814873"}},"Point":{"pos":"2.324642 48.813520"}}}]}}}"; \ No newline at end of file +s:1131:"{"response":{"Attribution":"","GeoObjectCollection":{"metaDataProperty":{"GeocoderResponseMetaData":{"request":"10 avenue Gambetta, Paris, France","found":"1","results":"5"}},"featureMember":[{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"Франция, Иль-Де-Франс, Париж, XX округ, Avenue Gambetta, 10","precision":"exact","AddressDetails":{"Country":{"AddressLine":"Иль-Де-Франс, Париж, XX округ, Avenue Gambetta, 10","CountryNameCode":"FR","CountryName":"Франция","AdministrativeArea":{"AdministrativeAreaName":"Иль-Де-Франс","SubAdministrativeArea":{"SubAdministrativeAreaName":"Париж","Locality":{"LocalityName":"Париж","DependentLocality":{"DependentLocalityName":"XX округ","Thoroughfare":{"ThoroughfareName":"Avenue Gambetta","Premise":{"PremiseNumber":"10"}}}}}}}}}},"description":"XX округ, Париж, Иль-Де-Франс, Франция","name":"Avenue Gambetta, 10","boundedBy":{"Envelope":{"lowerCorner":"2.380841 48.857747","upperCorner":"2.397298 48.868605"}},"Point":{"pos":"2.389069 48.863177"}}}]}}}"; \ No newline at end of file diff --git a/tests/.cached_responses/87d9131d36cefc486b1726e833c6e852ab44c929 b/tests/.cached_responses/87d9131d36cefc486b1726e833c6e852ab44c929 new file mode 100644 index 000000000..6120272fe --- /dev/null +++ b/tests/.cached_responses/87d9131d36cefc486b1726e833c6e852ab44c929 @@ -0,0 +1 @@ +s:1305:"{"authenticationResultCode":"ValidCredentials","brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png","copyright":"Copyright © 2015 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","resourceSets":[{"estimatedTotal":1,"resources":[{"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1","bbox":[48.8593536825758,2.3809437474984421,48.867079117717154,2.3966002741080024],"name":"10 Avenue Gambetta, 75020 Paris","point":{"type":"Point","coordinates":[48.863216400146477,2.3887720108032222]},"address":{"addressLine":"10 Avenue Gambetta","adminDistrict":"IdF","adminDistrict2":"Paris","countryRegion":"France","formattedAddress":"10 Avenue Gambetta, 75020 Paris","locality":"Paris","postalCode":"75020"},"confidence":"High","entityType":"Address","geocodePoints":[{"type":"Point","coordinates":[48.863216400146477,2.3887720108032222],"calculationMethod":"Interpolation","usageTypes":["Display","Route"]}],"matchCodes":["Good"]}]}],"statusCode":200,"statusDescription":"OK","traceId":"35653642b563464a8587835a9c7be49d|DB40190459|02.00.119.2100|DB4SCH010031557, DB4SCH010070355"}"; \ No newline at end of file diff --git a/tests/.cached_responses/8818e01b5730caaa37d6e7c04cd6f020e93bb8cd b/tests/.cached_responses/8818e01b5730caaa37d6e7c04cd6f020e93bb8cd index e8ee63a42..f81d4bfb1 100644 --- a/tests/.cached_responses/8818e01b5730caaa37d6e7c04cd6f020e93bb8cd +++ b/tests/.cached_responses/8818e01b5730caaa37d6e7c04cd6f020e93bb8cd @@ -1 +1 @@ -s:3530:"{"response":{"Attribution":"","GeoObjectCollection":{"metaDataProperty":{"GeocoderResponseMetaData":{"request":"29.198184,40.900640","found":"95","results":"5","boundedBy":{"Envelope":{"lowerCorner":"28.948183 40.650166","upperCorner":"29.448185 41.150162"}},"Point":{"pos":"29.198184 40.900640"},"kind":"locality"}},"featureMember":[{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"locality","text":"Türkiye, İstanbul, Maltepe, Dragos","precision":"other","AddressDetails":{"Country":{"AddressLine":"İstanbul, Maltepe, Dragos","CountryNameCode":"TR","CountryName":"Türkiye","AdministrativeArea":{"AdministrativeAreaName":"İstanbul","SubAdministrativeArea":{"SubAdministrativeAreaName":"Maltepe","Locality":{"LocalityName":"Dragos"}}}}}}},"description":"Maltepe, İstanbul, Türkiye","name":"Dragos","boundedBy":{"Envelope":{"lowerCorner":"29.072708 40.860413","upperCorner":"29.204508 40.960403"}},"Point":{"pos":"29.138608 40.910427"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"locality","text":"Türkiye, İstanbul, Adalar, Kınalıada","precision":"other","AddressDetails":{"Country":{"AddressLine":"İstanbul, Adalar, Kınalıada","CountryNameCode":"TR","CountryName":"Türkiye","AdministrativeArea":{"AdministrativeAreaName":"İstanbul","SubAdministrativeArea":{"SubAdministrativeAreaName":"Adalar","Locality":{"LocalityName":"Kınalıada"}}}}}}},"description":"Adalar, İstanbul, Türkiye","name":"Kınalıada","boundedBy":{"Envelope":{"lowerCorner":"29.041662 40.903979","upperCorner":"29.056834 40.913718"}},"Point":{"pos":"29.052406 40.909398"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"locality","text":"Türkiye, İstanbul, Kadıköy, Şaşkınbakkal","precision":"other","AddressDetails":{"Country":{"AddressLine":"İstanbul, Kadıköy, Şaşkınbakkal","CountryNameCode":"TR","CountryName":"Türkiye","AdministrativeArea":{"AdministrativeAreaName":"İstanbul","SubAdministrativeArea":{"SubAdministrativeAreaName":"Kadıköy","Locality":{"LocalityName":"Şaşkınbakkal"}}}}}}},"description":"Kadıköy, İstanbul, Türkiye","name":"Şaşkınbakkal","boundedBy":{"Envelope":{"lowerCorner":"29.005819 40.91363","upperCorner":"29.13762 41.013538"}},"Point":{"pos":"29.071719 40.963603"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"locality","text":"Türkiye, İstanbul, Kadıköy, Ethemefendi","precision":"other","AddressDetails":{"Country":{"AddressLine":"İstanbul, Kadıköy, Ethemefendi","CountryNameCode":"TR","CountryName":"Türkiye","AdministrativeArea":{"AdministrativeAreaName":"İstanbul","SubAdministrativeArea":{"SubAdministrativeAreaName":"Kadıköy","Locality":{"LocalityName":"Ethemefendi"}}}}}}},"description":"Kadıköy, İstanbul, Türkiye","name":"Ethemefendi","boundedBy":{"Envelope":{"lowerCorner":"29.010346 40.926808","upperCorner":"29.142147 41.026697"}},"Point":{"pos":"29.076247 40.976771"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"locality","text":"Türkiye, İstanbul, Pendik, Kurna","precision":"other","AddressDetails":{"Country":{"AddressLine":"İstanbul, Pendik, Kurna","CountryNameCode":"TR","CountryName":"Türkiye","AdministrativeArea":{"AdministrativeAreaName":"İstanbul","SubAdministrativeArea":{"SubAdministrativeAreaName":"Pendik","Locality":{"LocalityName":"Kurna"}}}}}}},"description":"Pendik, İstanbul, Türkiye","name":"Kurna","boundedBy":{"Envelope":{"lowerCorner":"29.303476 40.930453","upperCorner":"29.400054 40.979508"}},"Point":{"pos":"29.340882 40.959313"}}}]}}}"; \ No newline at end of file +s:3256:"{"response":{"Attribution":"","GeoObjectCollection":{"metaDataProperty":{"GeocoderResponseMetaData":{"request":"29.198184,40.900640","found":"8","results":"5","boundedBy":{"Envelope":{"lowerCorner":"28.948183 40.650166","upperCorner":"29.448185 41.150162"}},"Point":{"pos":"29.198184 40.900640"},"kind":"locality"}},"featureMember":[{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"locality","text":"Türkiye, İstanbul, Adalar","precision":"other","AddressDetails":{"Country":{"AddressLine":"İstanbul, Adalar","CountryNameCode":"TR","CountryName":"Türkiye","AdministrativeArea":{"AdministrativeAreaName":"İstanbul","SubAdministrativeArea":{"SubAdministrativeAreaName":"Adalar","Locality":{"LocalityName":"Adalar"}}}}}}},"description":"İstanbul, Türkiye","name":"Adalar","boundedBy":{"Envelope":{"lowerCorner":"29.10723 40.853544","upperCorner":"29.139021 40.876111"}},"Point":{"pos":"29.129562 40.874652"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"locality","text":"Türkiye, İstanbul, Sultanbeyli","precision":"other","AddressDetails":{"Country":{"AddressLine":"İstanbul, Sultanbeyli","CountryNameCode":"TR","CountryName":"Türkiye","AdministrativeArea":{"AdministrativeAreaName":"İstanbul","SubAdministrativeArea":{"SubAdministrativeAreaName":"Sultanbeyli","Locality":{"LocalityName":"Sultanbeyli"}}}}}}},"description":"İstanbul, Türkiye","name":"Sultanbeyli","boundedBy":{"Envelope":{"lowerCorner":"29.244699 40.931768","upperCorner":"29.31192 41.00489"}},"Point":{"pos":"29.262001 40.968417"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"locality","text":"Türkiye, Kocaeli, Çayırova","precision":"other","AddressDetails":{"Country":{"AddressLine":"Kocaeli, Çayırova","CountryNameCode":"TR","CountryName":"Türkiye","AdministrativeArea":{"AdministrativeAreaName":"Kocaeli","SubAdministrativeArea":{"SubAdministrativeAreaName":"Çayırova","Locality":{"LocalityName":"Çayırova"}}}}}}},"description":"Kocaeli, Türkiye","name":"Çayırova","boundedBy":{"Envelope":{"lowerCorner":"29.350808 40.807747","upperCorner":"29.422673 40.849022"}},"Point":{"pos":"29.372233 40.824215"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"locality","text":"Türkiye, Kocaeli, Darıca","precision":"other","AddressDetails":{"Country":{"AddressLine":"Kocaeli, Darıca","CountryNameCode":"TR","CountryName":"Türkiye","AdministrativeArea":{"AdministrativeAreaName":"Kocaeli","SubAdministrativeArea":{"SubAdministrativeAreaName":"Darıca","Locality":{"LocalityName":"Darıca"}}}}}}},"description":"Kocaeli, Türkiye","name":"Darıca","boundedBy":{"Envelope":{"lowerCorner":"29.333462 40.753098","upperCorner":"29.425512 40.809364"}},"Point":{"pos":"29.384333 40.762176"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"locality","text":"Türkiye, İstanbul","precision":"other","AddressDetails":{"Country":{"AddressLine":"İstanbul","CountryNameCode":"TR","CountryName":"Türkiye","AdministrativeArea":{"AdministrativeAreaName":"İstanbul","Locality":{"LocalityName":"İstanbul"}}}}}},"description":"Türkiye","name":"İstanbul","boundedBy":{"Envelope":{"lowerCorner":"28.595549 40.811398","upperCorner":"29.4288 41.199235"}},"Point":{"pos":"28.967111 41.008925"}}}]}}}"; \ No newline at end of file diff --git a/tests/.cached_responses/88407af65febe0eeb74e18eadadfd8d33a05a7e8 b/tests/.cached_responses/88407af65febe0eeb74e18eadadfd8d33a05a7e8 deleted file mode 100644 index 402f6ab88..000000000 --- a/tests/.cached_responses/88407af65febe0eeb74e18eadadfd8d33a05a7e8 +++ /dev/null @@ -1,9 +0,0 @@ -s:275:" - - 49.831515 - -119.381857 - V1W3Z9 - -4208GALLAGHERS SKelownaBC - -"; \ No newline at end of file diff --git a/tests/.cached_responses/8eae3cccf86aedb7e793a3ef464e5e4ac91adaff b/tests/.cached_responses/8eae3cccf86aedb7e793a3ef464e5e4ac91adaff deleted file mode 100644 index 66e068500..000000000 --- a/tests/.cached_responses/8eae3cccf86aedb7e793a3ef464e5e4ac91adaff +++ /dev/null @@ -1 +0,0 @@ -s:2450:"{"results":[{"locations":[{"latLng":{"lng":9.738553,"lat":52.374478},"adminArea4":"Region Hannover","adminArea5Type":"City","adminArea4Type":"County","adminArea5":"Hanover","street":"","adminArea1":"DE","adminArea3":"Niedersachsen (Landmasse)","type":"s","displayLatLng":{"lng":9.738553,"lat":52.374478},"linkId":0,"postalCode":"","sideOfStreet":"N","dragPoint":false,"adminArea1Type":"Country","geocodeQuality":"CITY","geocodeQualityCode":"A5XBX","adminArea3Type":"State"},{"latLng":{"lng":-78.131484,"lat":18.383715},"adminArea4":"Hanover","adminArea5Type":"City","adminArea4Type":"County","adminArea5":"","street":"","adminArea1":"JM","adminArea3":"","type":"s","displayLatLng":{"lng":-78.131484,"lat":18.383715},"linkId":0,"postalCode":"","sideOfStreet":"N","dragPoint":false,"adminArea1Type":"Country","geocodeQuality":"COUNTY","geocodeQualityCode":"A4XBX","adminArea3Type":"State"},{"latLng":{"lng":-72.288566,"lat":43.703307},"adminArea4":"Grafton County","adminArea5Type":"City","adminArea4Type":"County","adminArea5":"Hanover","street":"","adminArea1":"US","adminArea3":"NH","type":"s","displayLatLng":{"lng":-72.288566,"lat":43.703307},"linkId":0,"postalCode":"","sideOfStreet":"N","dragPoint":false,"adminArea1Type":"Country","geocodeQuality":"CITY","geocodeQualityCode":"A5XBX","adminArea3Type":"State"},{"latLng":{"lng":-76.984274,"lat":39.806325},"adminArea4":"York County","adminArea5Type":"City","adminArea4Type":"County","adminArea5":"Hanover","street":"","adminArea1":"US","adminArea3":"PA","type":"s","displayLatLng":{"lng":-76.984274,"lat":39.806325},"linkId":0,"postalCode":"","sideOfStreet":"N","dragPoint":false,"adminArea1Type":"Country","geocodeQuality":"CITY","geocodeQualityCode":"A5XBX","adminArea3Type":"State"},{"latLng":{"lng":-76.724137,"lat":39.192885},"adminArea4":"Howard","adminArea5Type":"City","adminArea4Type":"County","adminArea5":"Hanover","street":"","adminArea1":"US","adminArea3":"MD","type":"s","displayLatLng":{"lng":-76.724137,"lat":39.192885},"linkId":0,"postalCode":"","sideOfStreet":"N","dragPoint":false,"adminArea1Type":"Country","geocodeQuality":"CITY","geocodeQualityCode":"A5XBX","adminArea3Type":"State"}],"providedLocation":{"location":"Hanover"}}],"options":{"ignoreLatLngInput":false,"maxResults":5,"thumbMaps":false},"info":{"copyright":{"text":"© 2013 MapQuest, Inc.","imageUrl":"http://api.mqcdn.com/res/mqlogo.gif","imageAltText":"© 2013 MapQuest, Inc."},"statuscode":0,"messages":[]}}"; \ No newline at end of file diff --git a/tests/.cached_responses/8fa395e80c0be73710869507b0e0cdf336c7d391 b/tests/.cached_responses/8fa395e80c0be73710869507b0e0cdf336c7d391 deleted file mode 100644 index d60b73d83..000000000 --- a/tests/.cached_responses/8fa395e80c0be73710869507b0e0cdf336c7d391 +++ /dev/null @@ -1,291 +0,0 @@ -s:8732:"{ - "results" : [ - { - "address_components" : [ - { - "long_name" : "Paris", - "short_name" : "Paris", - "types" : [ "locality", "political" ] - }, - { - "long_name" : "Paris", - "short_name" : "75", - "types" : [ "administrative_area_level_2", "political" ] - }, - { - "long_name" : "Île-de-France", - "short_name" : "IDF", - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "long_name" : "France", - "short_name" : "FR", - "types" : [ "country", "political" ] - } - ], - "formatted_address" : "Paris, France", - "geometry" : { - "bounds" : { - "northeast" : { - "lat" : 48.9021449, - "lng" : 2.4699208 - }, - "southwest" : { - "lat" : 48.815573, - "lng" : 2.224199 - } - }, - "location" : { - "lat" : 48.856614, - "lng" : 2.3522219 - }, - "location_type" : "APPROXIMATE", - "viewport" : { - "northeast" : { - "lat" : 48.9021449, - "lng" : 2.4699208 - }, - "southwest" : { - "lat" : 48.815573, - "lng" : 2.224199 - } - } - }, - "types" : [ "locality", "political" ] - }, - { - "address_components" : [ - { - "long_name" : "Paris", - "short_name" : "Paris", - "types" : [ "locality", "political" ] - }, - { - "long_name" : "Lamar", - "short_name" : "Lamar", - "types" : [ "administrative_area_level_2", "political" ] - }, - { - "long_name" : "Texas", - "short_name" : "TX", - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "long_name" : "United States", - "short_name" : "US", - "types" : [ "country", "political" ] - } - ], - "formatted_address" : "Paris, TX, USA", - "geometry" : { - "bounds" : { - "northeast" : { - "lat" : 33.7383781, - "lng" : -95.435455 - }, - "southwest" : { - "lat" : 33.6118529, - "lng" : -95.62792789999999 - } - }, - "location" : { - "lat" : 33.6609389, - "lng" : -95.55551299999999 - }, - "location_type" : "APPROXIMATE", - "viewport" : { - "northeast" : { - "lat" : 33.7383781, - "lng" : -95.435455 - }, - "southwest" : { - "lat" : 33.6118529, - "lng" : -95.62792789999999 - } - } - }, - "types" : [ "locality", "political" ] - }, - { - "address_components" : [ - { - "long_name" : "Paris", - "short_name" : "Paris", - "types" : [ "locality", "political" ] - }, - { - "long_name" : "Henry", - "short_name" : "Henry", - "types" : [ "administrative_area_level_2", "political" ] - }, - { - "long_name" : "Tennessee", - "short_name" : "TN", - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "long_name" : "United States", - "short_name" : "US", - "types" : [ "country", "political" ] - }, - { - "long_name" : "38242", - "short_name" : "38242", - "types" : [ "postal_code" ] - } - ], - "formatted_address" : "Paris, TN 38242, USA", - "geometry" : { - "bounds" : { - "northeast" : { - "lat" : 36.3291321, - "lng" : -88.2650759 - }, - "southwest" : { - "lat" : 36.266, - "lng" : -88.36711489999999 - } - }, - "location" : { - "lat" : 36.3020023, - "lng" : -88.32671069999999 - }, - "location_type" : "APPROXIMATE", - "viewport" : { - "northeast" : { - "lat" : 36.3291321, - "lng" : -88.2650759 - }, - "southwest" : { - "lat" : 36.266, - "lng" : -88.36711489999999 - } - } - }, - "types" : [ "locality", "political" ] - }, - { - "address_components" : [ - { - "long_name" : "Paris", - "short_name" : "Paris", - "types" : [ "locality", "political" ] - }, - { - "long_name" : "Paris", - "short_name" : "Paris", - "types" : [ "administrative_area_level_3", "political" ] - }, - { - "long_name" : "Edgar", - "short_name" : "Edgar", - "types" : [ "administrative_area_level_2", "political" ] - }, - { - "long_name" : "Illinois", - "short_name" : "IL", - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "long_name" : "United States", - "short_name" : "US", - "types" : [ "country", "political" ] - }, - { - "long_name" : "61944", - "short_name" : "61944", - "types" : [ "postal_code" ] - } - ], - "formatted_address" : "Paris, IL 61944, USA", - "geometry" : { - "bounds" : { - "northeast" : { - "lat" : 39.6485756, - "lng" : -87.6505408 - }, - "southwest" : { - "lat" : 39.581415, - "lng" : -87.721046 - } - }, - "location" : { - "lat" : 39.611146, - "lng" : -87.6961374 - }, - "location_type" : "APPROXIMATE", - "viewport" : { - "northeast" : { - "lat" : 39.6485756, - "lng" : -87.6505408 - }, - "southwest" : { - "lat" : 39.581415, - "lng" : -87.721046 - } - } - }, - "types" : [ "locality", "political" ] - }, - { - "address_components" : [ - { - "long_name" : "Paris", - "short_name" : "Paris", - "types" : [ "locality", "political" ] - }, - { - "long_name" : "Bourbon", - "short_name" : "Bourbon", - "types" : [ "administrative_area_level_2", "political" ] - }, - { - "long_name" : "Kentucky", - "short_name" : "KY", - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "long_name" : "United States", - "short_name" : "US", - "types" : [ "country", "political" ] - }, - { - "long_name" : "40361", - "short_name" : "40361", - "types" : [ "postal_code" ] - } - ], - "formatted_address" : "Paris, KY 40361, USA", - "geometry" : { - "bounds" : { - "northeast" : { - "lat" : 38.238271, - "lng" : -84.232089 - }, - "southwest" : { - "lat" : 38.164922, - "lng" : -84.3073259 - } - }, - "location" : { - "lat" : 38.2097987, - "lng" : -84.2529869 - }, - "location_type" : "APPROXIMATE", - "viewport" : { - "northeast" : { - "lat" : 38.238271, - "lng" : -84.232089 - }, - "southwest" : { - "lat" : 38.164922, - "lng" : -84.3073259 - } - } - }, - "types" : [ "locality", "political" ] - } - ], - "status" : "OK" -} -"; \ No newline at end of file diff --git a/tests/.cached_responses/8fe0b54dc231a396a65c35bc2acd58c1abf3f636 b/tests/.cached_responses/8fe0b54dc231a396a65c35bc2acd58c1abf3f636 deleted file mode 100644 index 5a7a0dd14..000000000 --- a/tests/.cached_responses/8fe0b54dc231a396a65c35bc2acd58c1abf3f636 +++ /dev/null @@ -1 +0,0 @@ -s:17:"Forbidden request"; \ No newline at end of file diff --git a/tests/.cached_responses/965146c2ba972feb059e57b7319d519cc749d771 b/tests/.cached_responses/965146c2ba972feb059e57b7319d519cc749d771 new file mode 100644 index 000000000..8159f7d2f --- /dev/null +++ b/tests/.cached_responses/965146c2ba972feb059e57b7319d519cc749d771 @@ -0,0 +1 @@ +s:14130:"{"totalResultsCount":5981,"geonames":[{"timezone":{"gmtOffset":0,"timeZoneId":"Europe/London","dstOffset":1},"bbox":{"east":0.45212493672385795,"south":51.15168939834484,"north":51.865368153380956,"west":-0.7036088539601859},"asciiName":"London","countryId":"2635167","fcl":"P","score":130.2335968017578,"adminId2":"2648110","countryCode":"GB","adminId1":"6269131","lat":"51.50853","fcode":"PPLC","continentCode":"EU","adminCode2":"GLA","adminCode1":"ENG","lng":"-0.12574","geonameId":2643743,"toponymName":"London","population":7556900,"adminName5":"","adminName4":"","adminName3":"","alternateNames":[{"name":"Лондан","lang":"ab"},{"name":"Londen","lang":"af"},{"name":"London","lang":"als"},{"name":"ለንደን","lang":"am"},{"name":"Londres","lang":"an"},{"name":"Lunden","lang":"ang"},{"name":"لندن","lang":"ar"},{"name":"ܠܘܢܕܘܢ","lang":"arc"},{"name":"لندن","lang":"arz"},{"name":"Londres","lang":"ast"},{"name":"London","lang":"az"},{"name":"Лондон","lang":"ba"},{"name":"Londres","lang":"bcl"},{"name":"Лёндан","lang":"be"},{"name":"Лондон","lang":"bg"},{"name":"লন্ডন","lang":"bn"},{"name":"ལོན་ཊོན།","lang":"bo"},{"name":"Londrez","lang":"br"},{"name":"London","lang":"bs"},{"name":"Londres","lang":"ca"},{"name":"Lùng-dŭng","lang":"cdo"},{"name":"ᎫᎴ ᏗᏍᎪᏂᎯᏱ","lang":"chr"},{"name":"لەندەن","lang":"ckb"},{"name":"Londra","lang":"co"},{"name":"Londýn","lang":"cs"},{"name":"Лондонъ","lang":"cu"},{"name":"Лондон","lang":"cv"},{"name":"Llundain","lang":"cy"},{"name":"London","lang":"da"},{"name":"London","lang":"de"},{"name":"Londra","lang":"diq"},{"name":"Λονδίνο","lang":"el"},{"name":"London","lang":"en"},{"name":"Londono","lang":"eo"},{"name":"Londres","lang":"es"},{"name":"London","lang":"et"},{"name":"Londres","lang":"eu"},{"name":"Londri","lang":"ext"},{"name":"لندن","lang":"fa"},{"name":"Lontoo","lang":"fi"},{"name":"Londres","lang":"fr"},{"name":"Londres","lang":"frp"},{"name":"Londen","lang":"fy"},{"name":"Londain","lang":"ga"},{"name":"倫敦","lang":"gan"},{"name":"Lunnainn","lang":"gd"},{"name":"Londres","lang":"gl"},{"name":"Londye","lang":"gn"},{"name":"લંડન","lang":"gu"},{"name":"Lunnin","lang":"gv"},{"name":"Lākana","lang":"haw"},{"name":"London","lang":"hbs"},{"name":"לונדון","lang":"he"},{"name":"लंदन","lang":"hi"},{"name":"London","lang":"hr"},{"name":"Lonn","lang":"ht"},{"name":"London","lang":"hu"},{"name":"Լոնդոն","lang":"hy"},{"name":"London","lang":"ia"},{"name":"LON","lang":"iata"},{"name":"London","lang":"id"},{"name":"Londres","lang":"ilo"},{"name":"London","lang":"io"},{"name":"London","lang":"is"},{"name":"Londra","lang":"it"},{"name":"ロンドン","lang":"ja"},{"name":"london","lang":"jbo"},{"name":"ლონდონი","lang":"ka"},{"name":"Лондон","lang":"kk"},{"name":"ಲಂಡನ್","lang":"kn"},{"name":"런던","lang":"ko"},{"name":"Лондон","lang":"koi"},{"name":"Лондон","lang":"krc"},{"name":"London","lang":"ku"},{"name":"Лондон","lang":"kv"},{"name":"Loundres","lang":"kw"},{"name":"Лондон","lang":"ky"},{"name":"Londinium","lang":"la"},{"name":"Londra","lang":"lad"},{"name":"London","lang":"lb"},{"name":"Лондон","lang":"lbe"},{"name":"Лондон","lang":"lez"},{"name":"Londe","lang":"li"},{"name":"Londra","lang":"lij"},{"name":"http://en.wikipedia.org/wiki/London","lang":"link"},{"name":"Lundra","lang":"lmo"},{"name":"Londoni","lang":"ln"},{"name":"ລອນດອນ","lang":"lo"},{"name":"Londonas","lang":"lt"},{"name":"Londona","lang":"lv"},{"name":"Лондон","lang":"mhr"},{"name":"Rānana","lang":"mi"},{"name":"Лондон","lang":"mk"},{"name":"ലണ്ടൻ","lang":"ml"},{"name":"Лондон","lang":"mn"},{"name":"लंडन","lang":"mr"},{"name":"Лондон","lang":"mrj"},{"name":"London","lang":"ms"},{"name":"Londra","lang":"mt"},{"name":"Londres","lang":"mwl"},{"name":"လန်ဒန်မြို့","lang":"my"},{"name":"لندن","lang":"mzn"},{"name":"Londres","lang":"nah"},{"name":"Londra","lang":"nap"},{"name":"London","lang":"nds"},{"name":"लण्डन","lang":"ne"},{"name":"लण्डन","lang":"new"},{"name":"Londen","lang":"nl"},{"name":"London","lang":"nn"},{"name":"London","lang":"no"},{"name":"Londres","lang":"nrm"},{"name":"Londres","lang":"oc"},{"name":"ଲଣ୍ଡନ","lang":"or"},{"name":"Лондон","lang":"os"},{"name":"Londe","lang":"pcd"},{"name":"Londyn","lang":"pl"},{"name":"Londra","lang":"pms"},{"name":"لندن","lang":"pnb"},{"name":"Λονδίνο","lang":"pnt"},{"name":"لندن","lang":"ps"},{"name":"Londres","lang":"pt"},{"name":"London","lang":"qu"},{"name":"Londra","lang":"rm"},{"name":"Londra","lang":"ro"},{"name":"Лондон","lang":"ru"},{"name":"Лондон","lang":"rue"},{"name":"लन्डन्","lang":"sa"},{"name":"Лондон","lang":"sah"},{"name":"Londra","lang":"sc"},{"name":"Londra","lang":"scn"},{"name":"Lunnon","lang":"sco"},{"name":"ලන්ඩන්","lang":"si"},{"name":"Londýn","lang":"sk"},{"name":"London","lang":"sl"},{"name":"Londra","lang":"sq"},{"name":"Лондон","lang":"sr"},{"name":"London","lang":"sv"},{"name":"Lůndůn","lang":"szl"},{"name":"இலண்டன்","lang":"ta"},{"name":"లండన్","lang":"te"},{"name":"Londres","lang":"tet"},{"name":"Лондон","lang":"tg"},{"name":"ลอนดอน","lang":"th"},{"name":"Londres","lang":"tl"},{"name":"Landen","lang":"tpi"},{"name":"Londra","lang":"tr"},{"name":"Лондон","lang":"tt"},{"name":"Лондон","lang":"udm"},{"name":"لوندون","lang":"ug"},{"name":"Лондон","lang":"uk"},{"name":"LON","lang":"unlc"},{"name":"لندن","lang":"ur"},{"name":"Łondra","lang":"vec"},{"name":"Luân Đôn","lang":"vi"},{"name":"Londn","lang":"vls"},{"name":"London","lang":"vo"},{"name":"Londar","lang":"wo"},{"name":"伦敦","lang":"wuu"},{"name":"ლონდონი","lang":"xmf"},{"name":"לאנדאן","lang":"yi"},{"name":"Lọndọnu","lang":"yo"},{"name":"Londen","lang":"zea"},{"name":"伦敦","lang":"zh"},{"name":"伦敦","lang":"zh-CN"},{"name":"ILondon","lang":"zu"}],"adminName2":"Greater London","name":"London","fclName":"city, village,...","countryName":"United Kingdom","fcodeName":"capital of a political entity","adminName1":"England"},{"timezone":{"gmtOffset":2,"timeZoneId":"Africa/Johannesburg","dstOffset":2},"bbox":{"east":28.018503381239466,"south":-33.10499645800343,"north":-32.92557372892517,"west":27.804746435655137},"asciiName":"East London","countryId":"953987","fcl":"P","score":51.99159240722656,"cc2":"ZA","adminId2":"8347340","adminId3":"8347472","countryCode":"ZA","adminId1":"1085593","lat":"-33.01529","fcode":"PPLA2","continentCode":"AF","adminCode2":"BUF","adminCode3":"BUF","adminCode1":"05","lng":"27.91162","geonameId":1006984,"toponymName":"East London","population":478676,"adminName5":"","adminName4":"","adminName3":"Buffalo City","alternateNames":[{"name":"Oos Londen","lang":"af"},{"name":"Горад Іст-Лондан","lang":"be"},{"name":"Източен Лондон","lang":"bg"},{"name":"East London","lang":"da"},{"name":"East London","lang":"en"},{"name":"Orient-Londono","lang":"eo"},{"name":"East London","lang":"fi"},{"name":"East London","lang":"fr"},{"name":"Tûng Lùn-tûn","lang":"hak"},{"name":"איסט לונדון","lang":"he"},{"name":"ELS","lang":"iata"},{"name":"East London","lang":"id"},{"name":"イースト・ロンドン","lang":"ja"},{"name":"이스트런던","lang":"ko"},{"name":"Londinium Orientale","lang":"la"},{"name":"http://en.wikipedia.org/wiki/East_London%2C_Eastern_Cape","lang":"link"},{"name":"Yst Londonas","lang":"lt"},{"name":"ईस्ट लंडन","lang":"mr"},{"name":"Oost-Londen","lang":"nl"},{"name":"East London","lang":"pl"},{"name":"ایسٹ لندن","lang":"pnb"},{"name":"Ист-Лондон","lang":"ru"},{"name":"Источни Лондон","lang":"sr"},{"name":"Іст-Лондон","lang":"uk"},{"name":"ELS","lang":"unlc"},{"name":"東倫敦","lang":"zh"}],"adminName2":"Buffalo City Metropolitan Municipality","name":"East London","fclName":"city, village,...","countryName":"South Africa","fcodeName":"seat of a second-order administrative division","adminName1":"Eastern Cape"},{"timezone":{"gmtOffset":0,"timeZoneId":"Europe/London","dstOffset":1},"bbox":{"east":0.48608279418977673,"south":51.15594951276414,"north":51.86962826782626,"west":-0.6697604675296205},"asciiName":"City of London","countryId":"2635167","fcl":"P","score":48.792354583740234,"adminId2":"2648110","adminId3":"2643744","countryCode":"GB","adminId1":"6269131","lat":"51.51279","fcode":"PPLA3","continentCode":"EU","adminCode2":"GLA","adminCode3":"H9","adminCode1":"ENG","lng":"-0.09184","geonameId":2643741,"toponymName":"City of London","population":7556900,"adminName5":"","adminName4":"","adminName3":"City of London","alternateNames":[{"name":"Lundenceaster","lang":"ang"},{"name":"مدينة لندن","lang":"ar"},{"name":"Сіці","lang":"be"},{"name":"Сити","lang":"bg"},{"name":"Kêr Londrez","lang":"br"},{"name":"La City","lang":"ca"},{"name":"Dakbayan sa Londres","lang":"ceb"},{"name":"City","lang":"cs"},{"name":"Dinas Llundain","lang":"cy"},{"name":"Σίτι του Λονδίνου","lang":"el"},{"name":"City","lang":"eo"},{"name":"City de Londres","lang":"es"},{"name":"سیتی لندن","lang":"fa"},{"name":"Lontoon City","lang":"fi"},{"name":"Cité de Londres","lang":"fr"},{"name":"Cathair Londan","lang":"ga"},{"name":"Cidade de Londres","lang":"gl"},{"name":"הסיטי של לונדון","lang":"he"},{"name":"सिटी ऑफ़ लंदन","lang":"hi"},{"name":"Լոնդոնյան Սիթի","lang":"hy"},{"name":"Lundúnaborg","lang":"is"},{"name":"Città di Londra","lang":"it"},{"name":"シティ・オブ・ロンドン","lang":"ja"},{"name":"시티오브런던","lang":"ko"},{"name":"Urbs Londiniensis","lang":"la"},{"name":"http://en.wikipedia.org/wiki/City_of_London","lang":"link"},{"name":"Londono Sitis","lang":"lt"},{"name":"Londonas Sitija","lang":"lv"},{"name":"सिटी ऑफ लंडन","lang":"mr"},{"name":"Bandaraya London","lang":"ms"},{"name":"Cidade de Londres","lang":"mwl"},{"name":"Lûn-tun Chhī","lang":"nan"},{"name":"لندن شہر","lang":"pnb"},{"name":"Cidade de Londres","lang":"pt"},{"name":"Сити","lang":"ru"},{"name":"Ceety o Lunnon","lang":"sco"},{"name":"Сити","lang":"sr"},{"name":"นครลอนดอน","lang":"th"},{"name":"Lungsod ng Londres","lang":"tl"},{"name":"Londra Şehri","lang":"tr"},{"name":"Лондонське Сіті","lang":"uk"},{"name":"Thành phố Luân Đôn","lang":"vi"},{"name":"London","lang":"war"},{"name":"סיטי פון לאנדאן","lang":"yi"},{"name":"倫敦市","lang":"zh"},{"name":"Idolobha weLondon","lang":"zu"}],"adminName2":"Greater London","name":"City of London","fclName":"city, village,...","countryName":"United Kingdom","fcodeName":"seat of a third-order administrative division","adminName1":"England"},{"timezone":{"gmtOffset":-5,"timeZoneId":"America/Toronto","dstOffset":-4},"bbox":{"east":-81.12859509753737,"south":42.907075642763076,"north":43.05970292323693,"west":-81.33748967646262},"asciiName":"London","countryId":"6251999","fcl":"P","score":44.582420349121094,"countryCode":"CA","adminId1":"6093943","lat":"42.98339","fcode":"PPL","continentCode":"NA","adminCode1":"08","lng":"-81.23304","geonameId":6058560,"toponymName":"London","population":346765,"adminName5":"","adminName4":"","adminName3":"","alternateNames":[{"name":"لندن، أونتاريو","lang":"ar"},{"name":"Лондон","lang":"bg"},{"name":"London","lang":"de"},{"name":"London","lang":"en"},{"name":"Londono","lang":"eo"},{"name":"London","lang":"es"},{"name":"London","lang":"et"},{"name":"لندن، انتاریو","lang":"fa"},{"name":"London","lang":"fi"},{"name":"London","lang":"fr"},{"name":"לונדון","lang":"he"},{"name":"YXU","lang":"iata"},{"name":"ロンドン","lang":"ja"},{"name":"ლონდონი","lang":"ka"},{"name":"런던","lang":"ko"},{"name":"http://en.wikipedia.org/wiki/London%2C_Ontario","lang":"link"},{"name":"Londonas","lang":"lt"},{"name":"London","lang":"nl"},{"name":"Лондон","lang":"os"},{"name":"London","lang":"pl"},{"name":"لندن","lang":"pnb"},{"name":"London","lang":"pt"},{"name":"Лондон","lang":"ru"},{"name":"Лондон","lang":"sr"},{"name":"Лондон","lang":"uk"},{"name":"LOD","lang":"unlc"},{"name":"لندن، اونٹاریو","lang":"ur"},{"name":"伦敦","lang":"zh"},{"name":"伦敦","lang":"zh-CN"}],"adminName2":"","name":"London","fclName":"city, village,...","countryName":"Canada","fcodeName":"populated place","adminName1":"Ontario"},{"timezone":{"gmtOffset":-5,"timeZoneId":"America/New_York","dstOffset":-4},"bbox":{"east":-72.07078054515445,"south":41.334087887904154,"north":41.377219912095846,"west":-72.12826125484555},"asciiName":"New London","countryId":"6252001","fcl":"P","score":32.148841857910156,"adminId2":"4839420","countryCode":"US","adminId1":"4831725","lat":"41.35565","fcode":"PPL","continentCode":"NA","elevation":17,"adminCode2":"011","adminCode1":"CT","lng":"-72.09952","geonameId":4839416,"toponymName":"New London","population":27620,"adminName5":"","adminName4":"","adminName3":"","alternateNames":[{"name":"Ню Лъндън","lang":"bg"},{"name":"Nova Londres","lang":"ca"},{"name":"Llundain Newydd","lang":"cy"},{"name":"ニューロンドン","lang":"ja"},{"name":"Нью Лондон","lang":"kk"},{"name":"뉴런던","lang":"ko"},{"name":"http://en.wikipedia.org/wiki/New_London%2C_Connecticut","lang":"link"},{"name":"न्यू लंडन","lang":"mr"},{"name":"न्यु लंडन","lang":"new"},{"name":"06320","lang":"post"},{"name":"Нью-Лондон","lang":"ru"},{"name":"Њу Лондон","lang":"sr"},{"name":"Нью-Лондон","lang":"uk"},{"name":"NLO","lang":"unlc"},{"name":"新伦敦","lang":"zh"}],"adminName2":"New London County","name":"New London","fclName":"city, village,...","countryName":"United States","fcodeName":"populated place","adminName1":"Connecticut"}]}"; \ No newline at end of file diff --git a/tests/.cached_responses/b75d88797972f5ac9c69e1236aebbd390002c3bf b/tests/.cached_responses/96ae7399b6a2153e8d2c7d11829830f2711efb9f similarity index 100% rename from tests/.cached_responses/b75d88797972f5ac9c69e1236aebbd390002c3bf rename to tests/.cached_responses/96ae7399b6a2153e8d2c7d11829830f2711efb9f diff --git a/tests/.cached_responses/97387ac4fe9d9965f0e431afef9a7658bc37d0db b/tests/.cached_responses/97387ac4fe9d9965f0e431afef9a7658bc37d0db index a3839cc59..ad386f3a2 100644 --- a/tests/.cached_responses/97387ac4fe9d9965f0e431afef9a7658bc37d0db +++ b/tests/.cached_responses/97387ac4fe9d9965f0e431afef9a7658bc37d0db @@ -1 +1,3 @@ -s:223:"Unable to authenticate the request. Provided 'signature' is not valid for the provided client ID, or the provided 'client' is not valid. Learn more: https://developers.google.com/maps/documentation/business/webservices/auth"; \ No newline at end of file +s:473:"Unable to authenticate the request. Provided 'signature' is not valid for the provided client ID, or the provided 'client' is not valid. +The signature was checked against the URL: /maps/api/geocode/json?address=Columbia%20University&client=foo&signature=9dJq1hPF7_iwafUpnqXUqEkP0gY= +If this does not match the URL you requested, please ensure that your request is URL encoded correctly. Learn more: https://developers.google.com/maps/documentation/business/webservices/auth"; \ No newline at end of file diff --git a/tests/.cached_responses/fbed818d3fb568414d3fc7bd329473f6b9ed3b76 b/tests/.cached_responses/997bf83a1e8720db46bcd6d6014582d4adeddda0 similarity index 100% rename from tests/.cached_responses/fbed818d3fb568414d3fc7bd329473f6b9ed3b76 rename to tests/.cached_responses/997bf83a1e8720db46bcd6d6014582d4adeddda0 diff --git a/tests/.cached_responses/2f533a08ae0b6ca65e06bd8dd13f1ef50e94bba0 b/tests/.cached_responses/a6f5a65e97797392de77ec60d1e9ad9d457144a4 similarity index 100% rename from tests/.cached_responses/2f533a08ae0b6ca65e06bd8dd13f1ef50e94bba0 rename to tests/.cached_responses/a6f5a65e97797392de77ec60d1e9ad9d457144a4 diff --git a/tests/.cached_responses/a94552b2855c3efa518351bb1adc29bbfca0278f b/tests/.cached_responses/a94552b2855c3efa518351bb1adc29bbfca0278f deleted file mode 100644 index e211a6eef..000000000 --- a/tests/.cached_responses/a94552b2855c3efa518351bb1adc29bbfca0278f +++ /dev/null @@ -1 +0,0 @@ -s:6183:"{"geonames":[{"adminCode2":"GLA","alternateNames":[{"name":"Лондан","lang":"ab"},{"name":"Londen","lang":"af"},{"name":"London","lang":"als"},{"name":"ለንደን","lang":"am"},{"name":"Londres","lang":"an"},{"name":"Lunden","lang":"ang"},{"name":"لندن","lang":"ar"},{"name":"ܠܘܢܕܘܢ","lang":"arc"},{"name":"لندن","lang":"arz"},{"name":"Londres","lang":"ast"},{"name":"London","lang":"az"},{"name":"Лондон","lang":"ba"},{"name":"Londres","lang":"bcl"},{"name":"Горад Лондан","lang":"be"},{"name":"Лондон","lang":"bg"},{"name":"লন্ডন","lang":"bn"},{"name":"ལོན་ཊོན།","lang":"bo"},{"name":"Londrez","lang":"br"},{"name":"London","lang":"bs"},{"name":"Londres","lang":"ca"},{"name":"Lùng-dŭng","lang":"cdo"},{"name":"ᎫᎴ ᏗᏍᎪᏂᎯᏱ","lang":"chr"},{"name":"لەندەن","lang":"ckb"},{"name":"Londra","lang":"co"},{"name":"Londýn","lang":"cs"},{"name":"Лондонъ","lang":"cu"},{"name":"Лондон","lang":"cv"},{"name":"Llundain","lang":"cy"},{"name":"London","lang":"da"},{"name":"London","lang":"de"},{"name":"Londra","lang":"diq"},{"name":"Λονδίνο","lang":"el"},{"name":"London","lang":"en"},{"name":"Londono","lang":"eo"},{"name":"Londres","lang":"es"},{"name":"London","lang":"et"},{"name":"London","lang":"eu"},{"name":"Londri","lang":"ext"},{"name":"لندن","lang":"fa"},{"name":"Lontoo","lang":"fi"},{"name":"Londres","lang":"fr"},{"name":"Londres","lang":"frp"},{"name":"Londen","lang":"fy"},{"name":"Londain","lang":"ga"},{"name":"倫敦","lang":"gan"},{"name":"Lunnainn","lang":"gd"},{"name":"Londres","lang":"gl"},{"name":"Londye","lang":"gn"},{"name":"લંડન","lang":"gu"},{"name":"Lunnin","lang":"gv"},{"name":"Lākana","lang":"haw"},{"name":"London","lang":"hbs"},{"name":"לונדון","lang":"he"},{"name":"लंदन","lang":"hi"},{"name":"London","lang":"hr"},{"name":"Lonn","lang":"ht"},{"name":"London","lang":"hu"},{"name":"Լոնդոն","lang":"hy"},{"name":"London","lang":"ia"},{"name":"LON","lang":"iata"},{"name":"London","lang":"id"},{"name":"Londres","lang":"ilo"},{"name":"London","lang":"io"},{"name":"London","lang":"is"},{"name":"Londra","lang":"it"},{"name":"ロンドン","lang":"ja"},{"name":"london","lang":"jbo"},{"name":"ლონდონი","lang":"ka"},{"name":"Лондон","lang":"kk"},{"name":"ಲಂಡನ್","lang":"kn"},{"name":"런던","lang":"ko"},{"name":"Лондон","lang":"koi"},{"name":"Лондон","lang":"krc"},{"name":"London","lang":"ku"},{"name":"Лондон","lang":"kv"},{"name":"Loundres","lang":"kw"},{"name":"Лондон","lang":"ky"},{"name":"Londinium","lang":"la"},{"name":"Londra","lang":"lad"},{"name":"London","lang":"lb"},{"name":"Лондон","lang":"lbe"},{"name":"Лондон","lang":"lez"},{"name":"Londe","lang":"li"},{"name":"Londra","lang":"lij"},{"name":"http://en.wikipedia.org/wiki/London","lang":"link"},{"name":"Lundra","lang":"lmo"},{"name":"Londoni","lang":"ln"},{"name":"ລອນດອນ","lang":"lo"},{"name":"Londonas","lang":"lt"},{"name":"Londona","lang":"lv"},{"name":"Лондон","lang":"mhr"},{"name":"Rānana","lang":"mi"},{"name":"Лондон","lang":"mk"},{"name":"ലണ്ടൻ","lang":"ml"},{"name":"Лондон","lang":"mn"},{"name":"लंडन","lang":"mr"},{"name":"Лондон","lang":"mrj"},{"name":"London","lang":"ms"},{"name":"Londra","lang":"mt"},{"name":"Londres","lang":"mwl"},{"name":"လန်ဒန်မြို့","lang":"my"},{"name":"لندن","lang":"mzn"},{"name":"Londres","lang":"nah"},{"name":"Londra","lang":"nap"},{"name":"London","lang":"nds"},{"name":"लण्डन","lang":"ne"},{"name":"लण्डन","lang":"new"},{"name":"Londen","lang":"nl"},{"name":"London","lang":"nn"},{"name":"London","lang":"no"},{"name":"Londres","lang":"nrm"},{"name":"Londres","lang":"oc"},{"name":"ଲଣ୍ଡନ","lang":"or"},{"name":"Лондон","lang":"os"},{"name":"Londe","lang":"pcd"},{"name":"Londyn","lang":"pl"},{"name":"Londra","lang":"pms"},{"name":"لندن","lang":"pnb"},{"name":"Λονδίνο","lang":"pnt"},{"name":"لندن","lang":"ps"},{"name":"Londres","lang":"pt"},{"name":"London","lang":"qu"},{"name":"Londra","lang":"rm"},{"name":"Londra","lang":"ro"},{"name":"Лондон","lang":"ru"},{"name":"Лондон","lang":"rue"},{"name":"लन्डन्","lang":"sa"},{"name":"Лондон","lang":"sah"},{"name":"Londra","lang":"sc"},{"name":"Londra","lang":"scn"},{"name":"Lunnon","lang":"sco"},{"name":"ලන්ඩන්","lang":"si"},{"name":"Londýn","lang":"sk"},{"name":"London","lang":"sl"},{"name":"Londra","lang":"sq"},{"name":"Лондон","lang":"sr"},{"name":"London","lang":"sv"},{"name":"Lůndůn","lang":"szl"},{"name":"இலண்டன்","lang":"ta"},{"name":"లండన్","lang":"te"},{"name":"Londres","lang":"tet"},{"name":"Лондон","lang":"tg"},{"name":"ลอนดอน","lang":"th"},{"name":"Londres","lang":"tl"},{"name":"Landen","lang":"tpi"},{"name":"Londra","lang":"tr"},{"name":"Лондон","lang":"tt"},{"name":"Лондон","lang":"udm"},{"name":"لوندون","lang":"ug"},{"name":"Лондон","lang":"uk"},{"name":"لندن","lang":"ur"},{"name":"Łondra","lang":"vec"},{"name":"Luân Đôn","lang":"vi"},{"name":"Londn","lang":"vls"},{"name":"London","lang":"vo"},{"name":"Londar","lang":"wo"},{"name":"伦敦","lang":"wuu"},{"name":"ლონდონი","lang":"xmf"},{"name":"לאנדאן","lang":"yi"},{"name":"Lọndọnu","lang":"yo"},{"name":"Londen","lang":"zea"},{"name":"伦敦","lang":"zh"},{"name":"伦敦","lang":"zh-CN"},{"name":"ILondon","lang":"zu"}],"countryName":"United Kingdom","adminCode1":"ENG","lng":"-0.12574","adminName2":"Greater London","fcodeName":"capital of a political entity","adminName3":"","distance":"0.00019","timezone":{"dstOffset":1,"gmtOffset":0,"timeZoneId":"Europe/London"},"adminName4":"","adminName5":"","name":"London","fcode":"PPLC","geonameId":2643743,"lat":"51.50853","population":7556900,"adminName1":"England","adminId1":"6269131","countryId":"2635167","fclName":"city, village,...","elevation":0,"countryCode":"GB","adminId2":"2648110","wikipediaURL":"","toponymName":"London","fcl":"P","continentCode":"EU"}]}"; \ No newline at end of file diff --git a/tests/.cached_responses/9c19e1181083e48a07d9a4f45930541d22cf3b07 b/tests/.cached_responses/aafd96b49c2dfb6251cfed2cc9e68f202e15ecf6 similarity index 90% rename from tests/.cached_responses/9c19e1181083e48a07d9a4f45930541d22cf3b07 rename to tests/.cached_responses/aafd96b49c2dfb6251cfed2cc9e68f202e15ecf6 index 49a504339..4cff34ae7 100644 --- a/tests/.cached_responses/9c19e1181083e48a07d9a4f45930541d22cf3b07 +++ b/tests/.cached_responses/aafd96b49c2dfb6251cfed2cc9e68f202e15ecf6 @@ -1 +1 @@ -s:202:"US,"United States",TX,Texas,Plano,33.0347,-96.8134,623,972,America/Chicago,NA,75093,"Layered Technologies","Layered Technologies",,"AS22576 Layered Technologies, Inc.",Corporate,hosting,534,99,20,60,10,"; \ No newline at end of file +s:202:"US,"United States",TX,Texas,Plano,33.0347,-96.8134,623,972,America/Chicago,NA,75093,"Layered Technologies","Layered Technologies",,"AS22576 Layered Technologies, Inc.",Corporate,hosting,937,99,20,60,10,"; \ No newline at end of file diff --git a/tests/.cached_responses/ad6d784a78e64873da11acf325e3fbe50b7ba469 b/tests/.cached_responses/ad6d784a78e64873da11acf325e3fbe50b7ba469 deleted file mode 100644 index 3da8cc820..000000000 --- a/tests/.cached_responses/ad6d784a78e64873da11acf325e3fbe50b7ba469 +++ /dev/null @@ -1 +0,0 @@ -s:13831:"{"totalResultsCount":5317,"geonames":[{"adminCode2":"GLA","alternateNames":[{"name":"Лондан","lang":"ab"},{"name":"Londen","lang":"af"},{"name":"London","lang":"als"},{"name":"ለንደን","lang":"am"},{"name":"Londres","lang":"an"},{"name":"Lunden","lang":"ang"},{"name":"لندن","lang":"ar"},{"name":"ܠܘܢܕܘܢ","lang":"arc"},{"name":"لندن","lang":"arz"},{"name":"Londres","lang":"ast"},{"name":"London","lang":"az"},{"name":"Лондон","lang":"ba"},{"name":"Londres","lang":"bcl"},{"name":"Горад Лондан","lang":"be"},{"name":"Лондон","lang":"bg"},{"name":"লন্ডন","lang":"bn"},{"name":"ལོན་ཊོན།","lang":"bo"},{"name":"Londrez","lang":"br"},{"name":"London","lang":"bs"},{"name":"Londres","lang":"ca"},{"name":"Lùng-dŭng","lang":"cdo"},{"name":"ᎫᎴ ᏗᏍᎪᏂᎯᏱ","lang":"chr"},{"name":"لەندەن","lang":"ckb"},{"name":"Londra","lang":"co"},{"name":"Londýn","lang":"cs"},{"name":"Лондонъ","lang":"cu"},{"name":"Лондон","lang":"cv"},{"name":"Llundain","lang":"cy"},{"name":"London","lang":"da"},{"name":"London","lang":"de"},{"name":"Londra","lang":"diq"},{"name":"Λονδίνο","lang":"el"},{"name":"London","lang":"en"},{"name":"Londono","lang":"eo"},{"name":"Londres","lang":"es"},{"name":"London","lang":"et"},{"name":"London","lang":"eu"},{"name":"Londri","lang":"ext"},{"name":"لندن","lang":"fa"},{"name":"Lontoo","lang":"fi"},{"name":"Londres","lang":"fr"},{"name":"Londres","lang":"frp"},{"name":"Londen","lang":"fy"},{"name":"Londain","lang":"ga"},{"name":"倫敦","lang":"gan"},{"name":"Lunnainn","lang":"gd"},{"name":"Londres","lang":"gl"},{"name":"Londye","lang":"gn"},{"name":"લંડન","lang":"gu"},{"name":"Lunnin","lang":"gv"},{"name":"Lākana","lang":"haw"},{"name":"London","lang":"hbs"},{"name":"לונדון","lang":"he"},{"name":"लंदन","lang":"hi"},{"name":"London","lang":"hr"},{"name":"Lonn","lang":"ht"},{"name":"London","lang":"hu"},{"name":"Լոնդոն","lang":"hy"},{"name":"London","lang":"ia"},{"name":"LON","lang":"iata"},{"name":"London","lang":"id"},{"name":"Londres","lang":"ilo"},{"name":"London","lang":"io"},{"name":"Lundúnir","lang":"is"},{"name":"Londra","lang":"it"},{"name":"ロンドン","lang":"ja"},{"name":"london","lang":"jbo"},{"name":"ლონდონი","lang":"ka"},{"name":"Лондон","lang":"kk"},{"name":"ಲಂಡನ್","lang":"kn"},{"name":"런던","lang":"ko"},{"name":"Лондон","lang":"koi"},{"name":"Лондон","lang":"krc"},{"name":"London","lang":"ku"},{"name":"Лондон","lang":"kv"},{"name":"Loundres","lang":"kw"},{"name":"Лондон","lang":"ky"},{"name":"Londinium","lang":"la"},{"name":"Londra","lang":"lad"},{"name":"London","lang":"lb"},{"name":"Лондон","lang":"lbe"},{"name":"Лондон","lang":"lez"},{"name":"Londe","lang":"li"},{"name":"Londra","lang":"lij"},{"name":"http://en.wikipedia.org/wiki/London","lang":"link"},{"name":"Lundra","lang":"lmo"},{"name":"Londoni","lang":"ln"},{"name":"ລອນດອນ","lang":"lo"},{"name":"Londonas","lang":"lt"},{"name":"Londona","lang":"lv"},{"name":"Лондон","lang":"mhr"},{"name":"Rānana","lang":"mi"},{"name":"Лондон","lang":"mk"},{"name":"ലണ്ടൻ","lang":"ml"},{"name":"Лондон","lang":"mn"},{"name":"लंडन","lang":"mr"},{"name":"Лондон","lang":"mrj"},{"name":"London","lang":"ms"},{"name":"Londra","lang":"mt"},{"name":"Londres","lang":"mwl"},{"name":"လန်ဒန်မြို့","lang":"my"},{"name":"لندن","lang":"mzn"},{"name":"Londres","lang":"nah"},{"name":"Londra","lang":"nap"},{"name":"London","lang":"nds"},{"name":"लण्डन","lang":"ne"},{"name":"लण्डन","lang":"new"},{"name":"Londen","lang":"nl"},{"name":"London","lang":"nn"},{"name":"London","lang":"no"},{"name":"Londres","lang":"nrm"},{"name":"Londres","lang":"oc"},{"name":"ଲଣ୍ଡନ","lang":"or"},{"name":"Лондон","lang":"os"},{"name":"Londe","lang":"pcd"},{"name":"Londyn","lang":"pl"},{"name":"Londra","lang":"pms"},{"name":"لندن","lang":"pnb"},{"name":"Λονδίνο","lang":"pnt"},{"name":"لندن","lang":"ps"},{"name":"Londres","lang":"pt"},{"name":"London","lang":"qu"},{"name":"Londra","lang":"rm"},{"name":"Londra","lang":"ro"},{"name":"Лондон","lang":"ru"},{"name":"Лондон","lang":"rue"},{"name":"लन्डन्","lang":"sa"},{"name":"Лондон","lang":"sah"},{"name":"Londra","lang":"sc"},{"name":"Londra","lang":"scn"},{"name":"Lunnon","lang":"sco"},{"name":"ලන්ඩන්","lang":"si"},{"name":"Londýn","lang":"sk"},{"name":"London","lang":"sl"},{"name":"Londra","lang":"sq"},{"name":"Лондон","lang":"sr"},{"name":"London","lang":"sv"},{"name":"Lůndůn","lang":"szl"},{"name":"இலண்டன்","lang":"ta"},{"name":"లండన్","lang":"te"},{"name":"Londres","lang":"tet"},{"name":"Лондон","lang":"tg"},{"name":"ลอนดอน","lang":"th"},{"name":"Londres","lang":"tl"},{"name":"Landen","lang":"tpi"},{"name":"Londra","lang":"tr"},{"name":"Лондон","lang":"tt"},{"name":"Лондон","lang":"udm"},{"name":"لوندون","lang":"ug"},{"name":"Лондон","lang":"uk"},{"name":"لندن","lang":"ur"},{"name":"Łondra","lang":"vec"},{"name":"Luân Đôn","lang":"vi"},{"name":"Londn","lang":"vls"},{"name":"London","lang":"vo"},{"name":"Londar","lang":"wo"},{"name":"伦敦","lang":"wuu"},{"name":"ლონდონი","lang":"xmf"},{"name":"לאנדאן","lang":"yi"},{"name":"Lọndọnu","lang":"yo"},{"name":"Londen","lang":"zea"},{"name":"伦敦","lang":"zh"},{"name":"伦敦","lang":"zh-CN"},{"name":"ILondon","lang":"zu"}],"countryName":"United Kingdom","adminCode1":"ENG","score":129.77806091308594,"lng":"-0.12574","adminName2":"Greater London","fcodeName":"capital of a political entity","adminName3":"","timezone":{"dstOffset":1,"gmtOffset":0,"timeZoneId":"Europe/London"},"adminName4":"","adminName5":"","bbox":{"south":51.15168939834484,"east":0.45212493672385795,"north":51.865368153380956,"west":-0.7036088539601859},"name":"London","fcode":"PPLC","geonameId":2643743,"lat":"51.50853","population":7556900,"adminName1":"England","adminId1":"6269131","countryId":"2635167","fclName":"city, village,...","countryCode":"GB","adminId2":"2648110","wikipediaURL":"","toponymName":"London","fcl":"P","continentCode":"EU"},{"adminCode3":"BUF","adminCode2":"BUF","alternateNames":[{"name":"Oos Londen","lang":"af"},{"name":"Горад Іст-Лондан","lang":"be"},{"name":"Източен Лондон","lang":"bg"},{"name":"East London","lang":"da"},{"name":"East London","lang":"en"},{"name":"Orient-Londono","lang":"eo"},{"name":"East London","lang":"fi"},{"name":"East London","lang":"fr"},{"name":"איסט לונדון","lang":"he"},{"name":"ELS","lang":"iata"},{"name":"East London","lang":"id"},{"name":"イースト・ロンドン","lang":"ja"},{"name":"이스트런던","lang":"ko"},{"name":"Londinium Orientale","lang":"la"},{"name":"http://en.wikipedia.org/wiki/East_London%2C_Eastern_Cape","lang":"link"},{"name":"Yst Londonas","lang":"lt"},{"name":"ईस्ट लंडन","lang":"mr"},{"name":"Oost-Londen","lang":"nl"},{"name":"East London","lang":"pl"},{"name":"ایسٹ لندن","lang":"pnb"},{"name":"Ист-Лондон","lang":"ru"},{"name":"Источни Лондон","lang":"sr"},{"name":"Іст-Лондон","lang":"uk"},{"name":"ELS","lang":"unlc"},{"name":"東倫敦","lang":"zh"}],"countryName":"South Africa","adminCode1":"05","cc2":"ZA","score":60.44468688964844,"lng":"27.91162","adminName2":"Buffalo City Metropolitan Municipality","fcodeName":"seat of a second-order administrative division","adminName3":"Buffalo City","timezone":{"dstOffset":2,"gmtOffset":2,"timeZoneId":"Africa/Johannesburg"},"adminName4":"","adminName5":"","bbox":{"south":-33.10499645800343,"east":28.018503381239466,"north":-32.92557372892517,"west":27.804746435655137},"name":"East London","fcode":"PPLA2","geonameId":1006984,"lat":"-33.01529","population":478676,"adminName1":"Eastern Cape","adminId1":"1085593","countryId":"953987","fclName":"city, village,...","countryCode":"ZA","adminId3":"8347472","adminId2":"8347340","wikipediaURL":"","toponymName":"East London","fcl":"P","continentCode":"AF"},{"adminCode3":"H9","adminCode2":"GLA","alternateNames":[{"name":"مدينة لندن","lang":"ar"},{"name":"Сіці","lang":"be"},{"name":"Сити","lang":"bg"},{"name":"Kêr Londrez","lang":"br"},{"name":"La City","lang":"ca"},{"name":"Dakbayan sa Londres","lang":"ceb"},{"name":"City","lang":"cs"},{"name":"Dinas Llundain","lang":"cy"},{"name":"Σίτι του Λονδίνου","lang":"el"},{"name":"City","lang":"eo"},{"name":"City de Londres","lang":"es"},{"name":"سیتی لندن","lang":"fa"},{"name":"Lontoon City","lang":"fi"},{"name":"Cité de Londres","lang":"fr"},{"name":"Cathair Londan","lang":"ga"},{"name":"Cidade de Londres","lang":"gl"},{"name":"הסיטי של לונדון","lang":"he"},{"name":"सिटी ऑफ़ लंदन","lang":"hi"},{"name":"Լոնդոնյան Սիթի","lang":"hy"},{"name":"Lundúnaborg","lang":"is"},{"name":"Città di Londra","lang":"it"},{"name":"シティ・オブ・ロンドン","lang":"ja"},{"name":"시티오브런던","lang":"ko"},{"name":"Urbs Londiniensis","lang":"la"},{"name":"http://en.wikipedia.org/wiki/City_of_London","lang":"link"},{"name":"Londono Sitis","lang":"lt"},{"name":"Londonas Sitija","lang":"lv"},{"name":"सिटी ऑफ लंडन","lang":"mr"},{"name":"Bandaraya London","lang":"ms"},{"name":"لندن شہر","lang":"pnb"},{"name":"Cidade de Londres","lang":"pt"},{"name":"Сити","lang":"ru"},{"name":"Ceety o Lunnon","lang":"sco"},{"name":"Град Лондон","lang":"sr"},{"name":"นครลอนดอน","lang":"th"},{"name":"Lungsod ng Londres","lang":"tl"},{"name":"Londra Şehri","lang":"tr"},{"name":"Лондонське Сіті","lang":"uk"},{"name":"Thành phố Luân Đôn","lang":"vi"},{"name":"London","lang":"war"},{"name":"סיטי פון לאנדאן","lang":"yi"},{"name":"倫敦市","lang":"zh"},{"name":"Idolobha weLondon","lang":"zu"}],"countryName":"United Kingdom","adminCode1":"ENG","score":52.85734558105469,"lng":"-0.09184","adminName2":"Greater London","fcodeName":"seat of a third-order administrative division","adminName3":"City of London","timezone":{"dstOffset":1,"gmtOffset":0,"timeZoneId":"Europe/London"},"adminName4":"","adminName5":"","bbox":{"south":51.15594951276414,"east":0.48608279418977673,"north":51.86962826782626,"west":-0.6697604675296205},"name":"City of London","fcode":"PPLA3","geonameId":2643741,"lat":"51.51279","population":7556900,"adminName1":"England","adminId1":"6269131","countryId":"2635167","fclName":"city, village,...","countryCode":"GB","adminId3":"2643744","adminId2":"2648110","wikipediaURL":"","toponymName":"City of London","fcl":"P","continentCode":"EU"},{"alternateNames":[{"name":"لندن","lang":"ar"},{"name":"London","lang":"de"},{"name":"London","lang":"en"},{"name":"Londono","lang":"eo"},{"name":"London","lang":"es"},{"name":"London","lang":"et"},{"name":"لندن، انتاریو","lang":"fa"},{"name":"London","lang":"fi"},{"name":"London","lang":"fr"},{"name":"לונדון","lang":"he"},{"name":"YXU","lang":"iata"},{"name":"ロンドン","lang":"ja"},{"name":"ლონდონი","lang":"ka"},{"name":"런던","lang":"ko"},{"name":"http://en.wikipedia.org/wiki/London%2C_Ontario","lang":"link"},{"name":"Londonas","lang":"lt"},{"name":"London","lang":"nl"},{"name":"Лондон","lang":"os"},{"name":"London","lang":"pl"},{"name":"لندن","lang":"pnb"},{"name":"London","lang":"pt"},{"name":"Лондон","lang":"ru"},{"name":"Лондон","lang":"sr"},{"name":"Лондон","lang":"uk"},{"name":"LOD","lang":"unlc"},{"name":"لندن، اونٹاریو","lang":"ur"},{"name":"伦敦","lang":"zh"},{"name":"伦敦","lang":"zh-CN"}],"countryName":"Canada","adminCode1":"08","score":51.809730529785156,"lng":"-81.23304","adminName2":"","fcodeName":"populated place","adminName3":"","timezone":{"dstOffset":-4,"gmtOffset":-5,"timeZoneId":"America/Toronto"},"adminName4":"","adminName5":"","bbox":{"south":42.907075642763076,"east":-81.12859509753737,"north":43.05970292323693,"west":-81.33748967646262},"name":"London","fcode":"PPL","geonameId":6058560,"lat":"42.98339","population":346765,"adminName1":"Ontario","countryId":"6251999","adminId1":"6093943","fclName":"city, village,...","countryCode":"CA","wikipediaURL":"","toponymName":"London","fcl":"P","continentCode":"NA"},{"adminCode2":"011","alternateNames":[{"name":"Ню Лъндън","lang":"bg"},{"name":"Nova Londres","lang":"ca"},{"name":"Llundain Newydd","lang":"cy"},{"name":"ニューロンドン","lang":"ja"},{"name":"Нью Лондон","lang":"kk"},{"name":"뉴런던","lang":"ko"},{"name":"http://en.wikipedia.org/wiki/New_London%2C_Connecticut","lang":"link"},{"name":"न्यू लंडन","lang":"mr"},{"name":"06320","lang":"post"},{"name":"Нью-Лондон","lang":"ru"},{"name":"Њу Лондон","lang":"sr"},{"name":"Нью-Лондон","lang":"uk"},{"name":"NLO","lang":"unlc"},{"name":"新伦敦","lang":"zh"}],"countryName":"United States","adminCode1":"CT","score":31.414264678955078,"lng":"-72.09952","adminName2":"New London County","fcodeName":"populated place","adminName3":"","timezone":{"dstOffset":-4,"gmtOffset":-5,"timeZoneId":"America/New_York"},"adminName4":"","adminName5":"","bbox":{"south":41.334087887904154,"east":-72.07078054515445,"north":41.377219912095846,"west":-72.12826125484555},"name":"New London","fcode":"PPL","geonameId":4839416,"lat":"41.35565","population":27620,"adminName1":"Connecticut","adminId1":"4831725","countryId":"6252001","fclName":"city, village,...","elevation":17,"countryCode":"US","adminId2":"4839420","wikipediaURL":"","toponymName":"New London","fcl":"P","continentCode":"NA"}]}"; \ No newline at end of file diff --git a/tests/.cached_responses/ec3b49108dc2f482da5a31f580522026fdf9816d b/tests/.cached_responses/adef4e872257cb73774056a6462601a02cdbcb5a similarity index 75% rename from tests/.cached_responses/ec3b49108dc2f482da5a31f580522026fdf9816d rename to tests/.cached_responses/adef4e872257cb73774056a6462601a02cdbcb5a index ed25a9e27..c01f47997 100644 --- a/tests/.cached_responses/ec3b49108dc2f482da5a31f580522026fdf9816d +++ b/tests/.cached_responses/adef4e872257cb73774056a6462601a02cdbcb5a @@ -1,4 +1,4 @@ -s:9574:"{ +s:10811:"{ "licenses" : [ { "name" : "CC-BY-SA", @@ -11,14 +11,22 @@ s:9574:"{ ], "rate" : { "limit" : 2500, - "remaining" : 2490, - "reset" : 1418601600 + "remaining" : 2475, + "reset" : 1422835200 }, "results" : [ { "annotations" : { + "DMS" : { + "lat" : "51\u00b0 30' 26.35884'' N", + "lng" : "0\u00b0 7' 39.53064'' E" + }, "MGRS" : "30UXC9932710155", "Maidenhead" : "IO91wm41qs", + "Mercator" : { + "x" : -14209.644, + "y" : 6678063.768 + }, "OSGB" : { "easting" : 529926.637, "gridref" : "TQ 299 804", @@ -31,14 +39,14 @@ s:9574:"{ "geohash" : "gcpvj0e5csepnkstrhwy", "sun" : { "rise" : { - "astronomical" : 1418536380, - "civil" : 1418541420, - "nautical" : 1418538840 + "astronomical" : 1422769320, + "civil" : 1422774060, + "nautical" : 1422771660 }, "set" : { - "astronomical" : 1418579820, - "civil" : 1418574840, - "nautical" : 1418577420 + "astronomical" : 1422816420, + "civil" : 1422811680, + "nautical" : 1422814080 } }, "timezone" : { @@ -79,8 +87,16 @@ s:9574:"{ }, { "annotations" : { + "DMS" : { + "lat" : "42\u00b0 59' 17.14920'' N", + "lng" : "81\u00b0 14' 45.70620'' W" + }, "MGRS" : "17TMH7994259522", "Maidenhead" : "EN92jx07ld", + "Mercator" : { + "x" : -9044266.633, + "y" : 5281016.75 + }, "OSM" : { "url" : "http://www.openstreetmap.org/?mlat=42.98810&mlon=-81.24603#map=17/42.98810/-81.24603" }, @@ -88,14 +104,14 @@ s:9574:"{ "geohash" : "dpwhx1wry61e0k07ppd4", "sun" : { "rise" : { - "astronomical" : 1418555100, - "civil" : 1418559300, - "nautical" : 1418557140 + "astronomical" : 1422788460, + "civil" : 1422792480, + "nautical" : 1422790440 }, "set" : { - "astronomical" : 1418600100, - "civil" : 1418595900, - "nautical" : 1418598060 + "astronomical" : 1422749820, + "civil" : 1422832200, + "nautical" : 1422834240 } }, "timezone" : { @@ -134,8 +150,16 @@ s:9574:"{ }, { "annotations" : { + "DMS" : { + "lat" : "37\u00b0 7' 44.31756'' N", + "lng" : "84\u00b0 4' 59.75256'' W" + }, "MGRS" : "16SGG5911113163", "Maidenhead" : "EM77xd00aw", + "Mercator" : { + "x" : -9360106.2, + "y" : 4431306.03 + }, "OSM" : { "url" : "http://www.openstreetmap.org/?mlat=37.12898&mlon=-84.08326#map=17/37.12898/-84.08326" }, @@ -143,14 +167,14 @@ s:9574:"{ "geohash" : "dns5nxh7vyvxtbc60qcu", "sun" : { "rise" : { - "astronomical" : 1418555280, - "civil" : 1418559120, - "nautical" : 1418557140 + "astronomical" : 1422788880, + "civil" : 1422792600, + "nautical" : 1422790740 }, "set" : { - "astronomical" : 1418601300, - "civil" : 1418597460, - "nautical" : 1418599380 + "astronomical" : 1422750720, + "civil" : 1422833460, + "nautical" : 1422748920 } }, "timezone" : { @@ -190,8 +214,16 @@ s:9574:"{ }, { "annotations" : { + "DMS" : { + "lat" : "43\u00b0 2' 51.99900'' N", + "lng" : "89\u00b0 0' 46.39716'' W" + }, "MGRS" : "16TCN3605768086", "Maidenhead" : "EN53lb81kl", + "Mercator" : { + "x" : -9908869.377, + "y" : 5290070.766 + }, "OSM" : { "url" : "http://www.openstreetmap.org/?mlat=43.04778&mlon=-89.01289#map=17/43.04778/-89.01289" }, @@ -199,14 +231,14 @@ s:9574:"{ "geohash" : "dp8sykwg3r7gpmsn4b9x", "sun" : { "rise" : { - "astronomical" : 1418556960, - "civil" : 1418561160, - "nautical" : 1418559060 + "astronomical" : 1422790320, + "civil" : 1422794340, + "nautical" : 1422792300 }, "set" : { - "astronomical" : 1418515560, - "civil" : 1418597760, - "nautical" : 1418599920 + "astronomical" : 1422751680, + "civil" : 1422834060, + "nautical" : 1422749700 } }, "timezone" : { @@ -246,8 +278,16 @@ s:9574:"{ }, { "annotations" : { + "DMS" : { + "lat" : "39\u00b0 53' 11.21748'' N", + "lng" : "83\u00b0 26' 53.71080'' W" + }, "MGRS" : "17SKE9066018023", "Maidenhead" : "EM89gv62fr", + "Mercator" : { + "x" : -9289417.032, + "y" : 4822049.27 + }, "OSM" : { "url" : "http://www.openstreetmap.org/?mlat=39.88645&mlon=-83.44825#map=17/39.88645/-83.44825" }, @@ -255,14 +295,14 @@ s:9574:"{ "geohash" : "dphdvj4g6v09uv0q3rxk", "sun" : { "rise" : { - "astronomical" : 1418555340, - "civil" : 1418559360, - "nautical" : 1418557320 + "astronomical" : 1422788880, + "civil" : 1422792720, + "nautical" : 1422790740 }, "set" : { - "astronomical" : 1418600940, - "civil" : 1418596920, - "nautical" : 1418598960 + "astronomical" : 1422750480, + "civil" : 1422833040, + "nautical" : 1422834960 } }, "timezone" : { @@ -307,8 +347,8 @@ s:9574:"{ }, "thanks" : "For using an OpenCage Data API", "timestamp" : { - "created_http" : "Sun, 14 Dec 2014 18:40:45 GMT", - "created_unix" : 1418582445 + "created_http" : "Sun, 01 Feb 2015 16:13:43 GMT", + "created_unix" : 1422807223 }, "total_results" : 5, "we_are_hiring" : "http://lokku.com/#jobs" diff --git a/tests/.cached_responses/b1904b6be00241aeb68e1c59349434f0c985ca51 b/tests/.cached_responses/b1904b6be00241aeb68e1c59349434f0c985ca51 deleted file mode 100644 index 16f4bdf61..000000000 --- a/tests/.cached_responses/b1904b6be00241aeb68e1c59349434f0c985ca51 +++ /dev/null @@ -1 +0,0 @@ -s:1778:"{"found": 4, "bounds": [[48.85657, 2.35325], [48.85714, 2.35381]], "features": [{"id": 19590234,"centroid": {"type":"POINT","coordinates":[48.85657, 2.35325]},"bounds": [[48.85657, 2.35325], [48.85657, 2.35325]],"properties": {"addr:housenumber": "5", "osm_element": "node", "addr:street": "Rue Lobau", "synthesized_name": "5", "osm_id": "696674771"},"location": {"county": "Ile-del-france", "country": "France", "road": "Rue de Lobau", "city": "Paris"},"type": "Feature"},{"id": 19588873,"centroid": {"type":"POINT","coordinates":[48.85658, 2.35381]},"bounds": [[48.85658, 2.35381], [48.85658, 2.35381]],"properties": {"addr:housenumber": "4", "osm_element": "node", "addr:street": "Rue Lobau", "synthesized_name": "4", "osm_id": "696588653"},"location": {"county": "Ile-del-france", "country": "France", "road": "Rue de Lobau", "city": "Paris"},"type": "Feature"},{"id": 19666477,"centroid": {"type":"POINT","coordinates":[48.85714, 2.35348]},"bounds": [[48.85714, 2.35348], [48.85714, 2.35348]],"properties": {"addr:housenumber": "54", "osm_element": "node", "addr:street": "Rue de Rivoli", "synthesized_name": "54", "osm_id": "700449502"},"location": {"county": "Ile-del-france", "country": "France", "road": "Rue de Rivoli", "city": "Paris"},"type": "Feature"},{"id": 19666425,"centroid": {"type":"POINT","coordinates":[48.8571, 2.35362]},"bounds": [[48.85710, 2.35362], [48.85710, 2.35362]],"properties": {"addr:housenumber": "52", "osm_element": "node", "addr:street": "Rue de Rivoli", "synthesized_name": "52", "osm_id": "700449326"},"location": {"county": "Ile-del-france", "country": "France", "road": "Rue de Rivoli", "city": "Paris"},"type": "Feature"}], "type": "FeatureCollection", "crs": {"type": "EPSG", "properties": {"code": 4326, "coordinate_order": [0, 1]}}}"; \ No newline at end of file diff --git a/tests/.cached_responses/b4058fb568f89b9c4983e6aa2f32b4cd08ea74ba b/tests/.cached_responses/b4058fb568f89b9c4983e6aa2f32b4cd08ea74ba deleted file mode 100644 index 5e693fbf4..000000000 --- a/tests/.cached_responses/b4058fb568f89b9c4983e6aa2f32b4cd08ea74ba +++ /dev/null @@ -1 +0,0 @@ -s:1878:"55.70438912.546129u3buvkxv9fxzTomTomMappoi7311UNO-X København N0Uno-X2180.0TagensvejCopenhagueDanemarkDNK2200UNO-X København N, Tagensvej, 2200, Copenhague, DNKfalse111.01.00"; \ No newline at end of file diff --git a/tests/.cached_responses/b4b2d13284994cec6e72bdf72a17ae8ee713888a b/tests/.cached_responses/b4b2d13284994cec6e72bdf72a17ae8ee713888a new file mode 100644 index 000000000..211112d01 --- /dev/null +++ b/tests/.cached_responses/b4b2d13284994cec6e72bdf72a17ae8ee713888a @@ -0,0 +1 @@ +s:3873:"{"authenticationResultCode":"ValidCredentials","brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png","copyright":"Copyright © 2015 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","resourceSets":[{"estimatedTotal":5,"resources":[{"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1","bbox":[44.775325775146484,8.2711343765258789,44.795879364013672,8.2963142395019531],"name":"Castelnuovo Calcea, Piem., Italie","point":{"type":"Point","coordinates":[44.786701202392578,8.28419017791748]},"address":{"adminDistrict":"Piem.","adminDistrict2":"AT","countryRegion":"Italie","formattedAddress":"Castelnuovo Calcea, Piem., Italie","locality":"Castelnuovo Calcea"},"confidence":"High","entityType":"PopulatedPlace","geocodePoints":[{"type":"Point","coordinates":[44.786701202392578,8.28419017791748],"calculationMethod":"Rooftop","usageTypes":["Display"]}],"matchCodes":["Good"]},{"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1","bbox":[46.02923583984375,11.473880767822266,46.073772430419922,11.519126892089844],"name":"Castelnuovo, Tr.A.A., Italie","point":{"type":"Point","coordinates":[46.051799774169922,11.497699737548828]},"address":{"adminDistrict":"Tr.A.A.","adminDistrict2":"TN","countryRegion":"Italie","formattedAddress":"Castelnuovo, Tr.A.A., Italie","locality":"Castelnuovo"},"confidence":"High","entityType":"PopulatedPlace","geocodePoints":[{"type":"Point","coordinates":[46.051799774169922,11.497699737548828],"calculationMethod":"Rooftop","usageTypes":["Display"]}],"matchCodes":["Good"]},{"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1","bbox":[44.958910323794555,9.387852082690733,45.016851089779664,9.4970279832272357],"name":"Castelnuovo, Em.Rom., Italie","point":{"type":"Point","coordinates":[44.987880706787109,9.4424400329589844]},"address":{"adminDistrict":"Em.Rom.","adminDistrict2":"PC","countryRegion":"Italie","formattedAddress":"Castelnuovo, Em.Rom., Italie","locality":"Castelnuovo"},"confidence":"High","entityType":"Neighborhood","geocodePoints":[{"type":"Point","coordinates":[44.987880706787109,9.4424400329589844],"calculationMethod":"Rooftop","usageTypes":["Display"]}],"matchCodes":["Good"]},{"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1","bbox":[43.797411300357055,11.014744487392822,43.855352066342164,11.121775898349366],"name":"Castelnuovo, Tosc., Italie","point":{"type":"Point","coordinates":[43.826381683349609,11.068260192871094]},"address":{"adminDistrict":"Tosc.","adminDistrict2":"PO","countryRegion":"Italie","formattedAddress":"Castelnuovo, Tosc., Italie","locality":"Castelnuovo"},"confidence":"High","entityType":"Neighborhood","geocodePoints":[{"type":"Point","coordinates":[43.826381683349609,11.068260192871094],"calculationMethod":"Rooftop","usageTypes":["Display"]}],"matchCodes":["Good"]},{"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1","bbox":[42.266840316470336,13.574242599134211,42.324781082455445,13.678637497301336],"name":"Castelnuovo, Abr., Italie","point":{"type":"Point","coordinates":[42.295810699462891,13.626440048217773]},"address":{"adminDistrict":"Abr.","adminDistrict2":"AQ","countryRegion":"Italie","formattedAddress":"Castelnuovo, Abr., Italie","locality":"Castelnuovo"},"confidence":"High","entityType":"Neighborhood","geocodePoints":[{"type":"Point","coordinates":[42.295810699462891,13.626440048217773],"calculationMethod":"Rooftop","usageTypes":["Display"]}],"matchCodes":["Good"]}]}],"statusCode":200,"statusDescription":"OK","traceId":"b598695d63f34fdb8b711264d5e2bac9|DB40051734|02.00.119.2100|DB4SCH010060660, DB4SCH010070357"}"; \ No newline at end of file diff --git a/tests/.cached_responses/b5d39db33bc9c80e313ac2be24e744f86f48f286 b/tests/.cached_responses/b5d39db33bc9c80e313ac2be24e744f86f48f286 deleted file mode 100644 index 21ad59f46..000000000 --- a/tests/.cached_responses/b5d39db33bc9c80e313ac2be24e744f86f48f286 +++ /dev/null @@ -1,13 +0,0 @@ -s:387:" - - -1600 Pennsylvania Ave NW, Washington DC 20502 --77.037684 -38.898748 - - -"; \ No newline at end of file diff --git a/tests/.cached_responses/b5d692ab2cba63003d06933655016a406d04dbcf b/tests/.cached_responses/b5d692ab2cba63003d06933655016a406d04dbcf index d424d2ed2..43d5e454d 100644 --- a/tests/.cached_responses/b5d692ab2cba63003d06933655016a406d04dbcf +++ b/tests/.cached_responses/b5d692ab2cba63003d06933655016a406d04dbcf @@ -1 +1 @@ -s:3957:"{"response":{"Attribution":"","GeoObjectCollection":{"metaDataProperty":{"GeocoderResponseMetaData":{"request":"1600 Pennsylvania Ave, Washington","found":"30","results":"5"}},"featureMember":[{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"United States, District of Columbia, Washington, Pennsylvania Ave NW","precision":"street","AddressDetails":{"Country":{"AddressLine":"District of Columbia, Washington, Pennsylvania Ave NW","CountryNameCode":"US","CountryName":"United States","AdministrativeArea":{"AdministrativeAreaName":"District of Columbia","Locality":{"LocalityName":"Washington","Thoroughfare":{"ThoroughfareName":"Pennsylvania Ave NW"}}}}}}},"description":"Washington, District of Columbia, United States","name":"Pennsylvania Ave NW","boundedBy":{"Envelope":{"lowerCorner":"-77.058078 38.890563","upperCorner":"-77.012453 38.905248"}},"Point":{"pos":"-77.035270 38.898727"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"United States, District of Columbia, Washington, Pennsylvania Ave SE","precision":"street","AddressDetails":{"Country":{"AddressLine":"District of Columbia, Washington, Pennsylvania Ave SE","CountryNameCode":"US","CountryName":"United States","AdministrativeArea":{"AdministrativeAreaName":"District of Columbia","Locality":{"LocalityName":"Washington","Thoroughfare":{"ThoroughfareName":"Pennsylvania Ave SE"}}}}}}},"description":"Washington, District of Columbia, United States","name":"Pennsylvania Ave SE","boundedBy":{"Envelope":{"lowerCorner":"-77.003541 38.863739","upperCorner":"-76.946777 38.887832"}},"Point":{"pos":"-76.975244 38.875572"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"United States, Washington, Kitsap, Bremerton, Pennsylvania Ave","precision":"street","AddressDetails":{"Country":{"AddressLine":"Washington, Kitsap, Bremerton, Pennsylvania Ave","CountryNameCode":"US","CountryName":"United States","AdministrativeArea":{"AdministrativeAreaName":"Washington","Locality":{"LocalityName":"Kitsap","DependentLocality":{"DependentLocalityName":"Bremerton","Thoroughfare":{"ThoroughfareName":"Pennsylvania Ave"}}}}}}}},"description":"Bremerton, Kitsap, Washington, United States","name":"Pennsylvania Ave","boundedBy":{"Envelope":{"lowerCorner":"-122.642117 47.567359","upperCorner":"-122.642063 47.578119"}},"Point":{"pos":"-122.642072 47.572740"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"United States, Pennsylvania, Washington, California, Pennsylvania Ave","precision":"street","AddressDetails":{"Country":{"AddressLine":"Pennsylvania, Washington, California, Pennsylvania Ave","CountryNameCode":"US","CountryName":"United States","AdministrativeArea":{"AdministrativeAreaName":"Pennsylvania","Locality":{"LocalityName":"Washington","DependentLocality":{"DependentLocalityName":"California","Thoroughfare":{"ThoroughfareName":"Pennsylvania Ave"}}}}}}}},"description":"California, Washington, Pennsylvania, United States","name":"Pennsylvania Ave","boundedBy":{"Envelope":{"lowerCorner":"-79.898389 40.05744","upperCorner":"-79.885561 40.065039"}},"Point":{"pos":"-79.891957 40.061257"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"United States, Wisconsin, Washington, West Bend, Pennsylvania Ave","precision":"street","AddressDetails":{"Country":{"AddressLine":"Wisconsin, Washington, West Bend, Pennsylvania Ave","CountryNameCode":"US","CountryName":"United States","AdministrativeArea":{"AdministrativeAreaName":"Wisconsin","Locality":{"LocalityName":"Washington","DependentLocality":{"DependentLocalityName":"West Bend","Thoroughfare":{"ThoroughfareName":"Pennsylvania Ave"}}}}}}}},"description":"West Bend, Washington, Wisconsin, United States","name":"Pennsylvania Ave","boundedBy":{"Envelope":{"lowerCorner":"-88.174873 43.412991","upperCorner":"-88.172888 43.417968"}},"Point":{"pos":"-88.173750 43.415538"}}}]}}}"; \ No newline at end of file +s:4125:"{"response":{"Attribution":"","GeoObjectCollection":{"metaDataProperty":{"GeocoderResponseMetaData":{"request":"1600 Pennsylvania Ave, Washington","found":"33","results":"5"}},"featureMember":[{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"house","text":"United States, District of Columbia, Washington, Pennsylvania Ave NW, 1600","precision":"exact","AddressDetails":{"Country":{"AddressLine":"District of Columbia, Washington, Pennsylvania Ave NW, 1600","CountryNameCode":"US","CountryName":"United States","AdministrativeArea":{"AdministrativeAreaName":"District of Columbia","SubAdministrativeArea":{"SubAdministrativeAreaName":"District of Columbia","Locality":{"LocalityName":"Washington","Thoroughfare":{"ThoroughfareName":"Pennsylvania Ave NW","Premise":{"PremiseNumber":"1600"}}}}}}}}},"description":"Washington, District of Columbia, United States","name":"Pennsylvania Ave NW, 1600","boundedBy":{"Envelope":{"lowerCorner":"-77.046921 38.891265","upperCorner":"-77.030464 38.904125"}},"Point":{"pos":"-77.038692 38.897695"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"United States, District of Columbia, Washington, Pennsylvania Ave SE","precision":"street","AddressDetails":{"Country":{"AddressLine":"District of Columbia, Washington, Pennsylvania Ave SE","CountryNameCode":"US","CountryName":"United States","AdministrativeArea":{"AdministrativeAreaName":"District of Columbia","SubAdministrativeArea":{"SubAdministrativeAreaName":"District of Columbia","Locality":{"LocalityName":"Washington","Thoroughfare":{"ThoroughfareName":"Pennsylvania Ave SE"}}}}}}}},"description":"Washington, District of Columbia, United States","name":"Pennsylvania Ave SE","boundedBy":{"Envelope":{"lowerCorner":"-77.003532 38.863739","upperCorner":"-76.946777 38.887825"}},"Point":{"pos":"-76.975235 38.875565"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"United States, Maryland, Washington, Pennsylvania Ave","precision":"street","AddressDetails":{"Country":{"AddressLine":"Maryland, Washington, Pennsylvania Ave","CountryNameCode":"US","CountryName":"United States","AdministrativeArea":{"AdministrativeAreaName":"Maryland","SubAdministrativeArea":{"SubAdministrativeAreaName":"Washington","Locality":{"Thoroughfare":{"ThoroughfareName":"Pennsylvania Ave"}}}}}}}},"description":"Washington, Maryland, United States","name":"Pennsylvania Ave","boundedBy":{"Envelope":{"lowerCorner":"-77.724152 39.649717","upperCorner":"-77.717513 39.721407"}},"Point":{"pos":"-77.720774 39.685568"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"United States, Pennsylvania, Washington, Pennsylvania Ave","precision":"street","AddressDetails":{"Country":{"AddressLine":"Pennsylvania, Washington, Pennsylvania Ave","CountryNameCode":"US","CountryName":"United States","AdministrativeArea":{"AdministrativeAreaName":"Pennsylvania","Locality":{"DependentLocality":{"DependentLocalityName":"Washington","Thoroughfare":{"ThoroughfareName":"Pennsylvania Ave"}}}}}}}},"description":"Washington, Pennsylvania, United States","name":"Pennsylvania Ave","boundedBy":{"Envelope":{"lowerCorner":"-79.890044 40.118144","upperCorner":"-79.867263 40.131418"}},"Point":{"pos":"-79.878914 40.124233"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"United States, District of Columbia, Washington, Pennsylvania Avenue Rear SE","precision":"street","AddressDetails":{"Country":{"AddressLine":"District of Columbia, Washington, Pennsylvania Avenue Rear SE","CountryNameCode":"US","CountryName":"United States","AdministrativeArea":{"AdministrativeAreaName":"District of Columbia","SubAdministrativeArea":{"SubAdministrativeAreaName":"District of Columbia","Locality":{"LocalityName":"Washington","Thoroughfare":{"ThoroughfareName":"Pennsylvania Avenue Rear SE"}}}}}}}},"description":"Washington, District of Columbia, United States","name":"Pennsylvania Avenue Rear SE","boundedBy":{"Envelope":{"lowerCorner":"-76.98341 38.879315","upperCorner":"-76.981649 38.881175"}},"Point":{"pos":"-76.982790 38.879891"}}}]}}}"; \ No newline at end of file diff --git a/tests/.cached_responses/9ffb332bcb4007420b0688f0f97bfa983106fa6b b/tests/.cached_responses/ba69ac95396013dc9abd1342b1132a4027939ede similarity index 73% rename from tests/.cached_responses/9ffb332bcb4007420b0688f0f97bfa983106fa6b rename to tests/.cached_responses/ba69ac95396013dc9abd1342b1132a4027939ede index f83dcaccb..908e19809 100644 --- a/tests/.cached_responses/9ffb332bcb4007420b0688f0f97bfa983106fa6b +++ b/tests/.cached_responses/ba69ac95396013dc9abd1342b1132a4027939ede @@ -1,4 +1,4 @@ -s:3944:"{ +s:4438:"{ "licenses" : [ { "name" : "CC-BY-SA", @@ -11,14 +11,22 @@ s:3944:"{ ], "rate" : { "limit" : 2500, - "remaining" : 2491, - "reset" : 1418601600 + "remaining" : 2476, + "reset" : 1422835200 }, "results" : [ { "annotations" : { + "DMS" : { + "lat" : "50\u00b0 11' 20.62320'' N", + "lng" : "8\u00b0 38' 11.64123'' E" + }, "MGRS" : "32UMA7405659715", "Maidenhead" : "JO40he65jj", + "Mercator" : { + "x" : 961418.242, + "y" : 6446240.668 + }, "OSM" : { "url" : "http://www.openstreetmap.org/?mlat=50.18906&mlon=8.63657#map=17/50.18906/8.63657" }, @@ -26,14 +34,14 @@ s:3944:"{ "geohash" : "u0yjs88uqx70ec4w60ur", "sun" : { "rise" : { - "astronomical" : 1418534160, - "civil" : 1418539020, - "nautical" : 1418536560 + "astronomical" : 1422767160, + "civil" : 1422771780, + "nautical" : 1422769440 }, "set" : { - "astronomical" : 1418577840, - "civil" : 1418572980, - "nautical" : 1418575500 + "astronomical" : 1422814380, + "civil" : 1422809760, + "nautical" : 1422812100 } }, "timezone" : { @@ -79,22 +87,30 @@ s:3944:"{ }, { "annotations" : { + "DMS" : { + "lat" : "50\u00b0 11' 16.08000'' N", + "lng" : "8\u00b0 39' 47.52000'' E" + }, "MGRS" : "32UMA7595659565", "Maidenhead" : "JO40he95ob", + "Mercator" : { + "x" : 964383.013, + "y" : 6446021.855 + }, "OSM" : { "url" : "http://www.openstreetmap.org/?mlat=50.18780&mlon=8.66320#map=17/50.18780/8.66320" }, "geohash" : "u0yjt0km5hn07v28j4fu", "sun" : { "rise" : { - "astronomical" : 1418534160, - "civil" : 1418539020, - "nautical" : 1418536500 + "astronomical" : 1422767160, + "civil" : 1422771780, + "nautical" : 1422769440 }, "set" : { - "astronomical" : 1418577840, - "civil" : 1418572980, - "nautical" : 1418575500 + "astronomical" : 1422814380, + "civil" : 1422809760, + "nautical" : 1422812100 } }, "timezone" : { @@ -126,8 +142,8 @@ s:3944:"{ }, "thanks" : "For using an OpenCage Data API", "timestamp" : { - "created_http" : "Sun, 14 Dec 2014 18:40:43 GMT", - "created_unix" : 1418582443 + "created_http" : "Sun, 01 Feb 2015 16:13:42 GMT", + "created_unix" : 1422807222 }, "total_results" : 2, "we_are_hiring" : "http://lokku.com/#jobs" diff --git a/tests/.cached_responses/bb59351faf44013198f2879892f74e768e585758 b/tests/.cached_responses/bb59351faf44013198f2879892f74e768e585758 deleted file mode 100644 index 1a5ba31ae..000000000 --- a/tests/.cached_responses/bb59351faf44013198f2879892f74e768e585758 +++ /dev/null @@ -1 +0,0 @@ -s:1875:"55.70438912.546129u3buvkxv9fxzTomTomMappoi7311UNO-X København N0Uno-X2180.0TagensvejKöpenhamnDaniaDNK2200UNO-X København N, Tagensvej, 2200, Köpenhamn, DNKfalse111.01.00"; \ No newline at end of file diff --git a/tests/.cached_responses/c181c3f0f0d308dcf59024b03a203f30bb24a7df b/tests/.cached_responses/c181c3f0f0d308dcf59024b03a203f30bb24a7df index 7f33a5bea..360848b2c 100644 --- a/tests/.cached_responses/c181c3f0f0d308dcf59024b03a203f30bb24a7df +++ b/tests/.cached_responses/c181c3f0f0d308dcf59024b03a203f30bb24a7df @@ -1 +1 @@ -s:1768:"{"response":{"Attribution":"","GeoObjectCollection":{"metaDataProperty":{"GeocoderResponseMetaData":{"request":"2.388772,48.863216","found":"3","results":"5","Point":{"pos":"2.388772 48.863216"}}},"featureMember":[{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"Франция, Иль-Де-Франс, Avenue Gambetta","precision":"street","AddressDetails":{"Country":{"AddressLine":"Иль-Де-Франс, Avenue Gambetta","CountryNameCode":"FR","CountryName":"Франция","AdministrativeArea":{"AdministrativeAreaName":"Иль-Де-Франс","Locality":{"Thoroughfare":{"ThoroughfareName":"Avenue Gambetta"}}}}}}},"description":"Иль-Де-Франс, Франция","name":"Avenue Gambetta","boundedBy":{"Envelope":{"lowerCorner":"2.387497 48.86294","upperCorner":"2.423214 48.877067"}},"Point":{"pos":"2.388773 48.863212"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"province","text":"Франция, Иль-Де-Франс","precision":"other","AddressDetails":{"Country":{"AddressLine":"Иль-Де-Франс","CountryNameCode":"FR","CountryName":"Франция","AdministrativeArea":{"AdministrativeAreaName":"Иль-Де-Франс"}}}}},"description":"Франция","name":"Иль-Де-Франс","boundedBy":{"Envelope":{"lowerCorner":"1.446701 48.120318","upperCorner":"3.558523 49.2413"}},"Point":{"pos":"2.503371 48.709273"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"country","text":"Франция","precision":"other","AddressDetails":{"Country":{"CountryNameCode":"FR","CountryName":"Франция"}}}},"name":"Франция","boundedBy":{"Envelope":{"lowerCorner":"-5.1406 41.333742","upperCorner":"9.559323 51.089063"}},"Point":{"pos":"2.452041 46.621779"}}}]}}}"; \ No newline at end of file +s:3842:"{"response":{"Attribution":"","GeoObjectCollection":{"metaDataProperty":{"GeocoderResponseMetaData":{"request":"2.388772,48.863216","found":"7","results":"5","Point":{"pos":"2.388772 48.863216"}}},"featureMember":[{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"street","text":"Франция, Иль-Де-Франс, Париж, XX округ, Avenue Gambetta","precision":"street","AddressDetails":{"Country":{"AddressLine":"Иль-Де-Франс, Париж, XX округ, Avenue Gambetta","CountryNameCode":"FR","CountryName":"Франция","AdministrativeArea":{"AdministrativeAreaName":"Иль-Де-Франс","SubAdministrativeArea":{"SubAdministrativeAreaName":"Париж","Locality":{"LocalityName":"Париж","DependentLocality":{"DependentLocalityName":"XX округ","Thoroughfare":{"ThoroughfareName":"Avenue Gambetta"}}}}}}}}},"description":"XX округ, Париж, Иль-Де-Франс, Франция","name":"Avenue Gambetta","boundedBy":{"Envelope":{"lowerCorner":"2.387497 48.86294","upperCorner":"2.406587 48.877067"}},"Point":{"pos":"2.388773 48.863212"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"district","text":"Франция, Иль-Де-Франс, Париж, XX округ","precision":"other","AddressDetails":{"Country":{"AddressLine":"Иль-Де-Франс, Париж, XX округ","CountryNameCode":"FR","CountryName":"Франция","AdministrativeArea":{"AdministrativeAreaName":"Иль-Де-Франс","SubAdministrativeArea":{"SubAdministrativeAreaName":"Париж","Locality":{"LocalityName":"Париж","DependentLocality":{"DependentLocalityName":"XX округ"}}}}}}}},"description":"Париж, Иль-Де-Франс, Франция","name":"XX округ","boundedBy":{"Envelope":{"lowerCorner":"2.377939 48.846697","upperCorner":"2.416217 48.878252"}},"Point":{"pos":"2.399355 48.864848"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"locality","text":"Франция, Иль-Де-Франс, Париж","precision":"other","AddressDetails":{"Country":{"AddressLine":"Иль-Де-Франс, Париж","CountryNameCode":"FR","CountryName":"Франция","AdministrativeArea":{"AdministrativeAreaName":"Иль-Де-Франс","SubAdministrativeArea":{"SubAdministrativeAreaName":"Париж","Locality":{"LocalityName":"Париж"}}}}}}},"description":"Иль-Де-Франс, Франция","name":"Париж","boundedBy":{"Envelope":{"lowerCorner":"2.251232 48.815727","upperCorner":"2.416235 48.902474"}},"Point":{"pos":"2.341198 48.856929"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"area","text":"Франция, Иль-Де-Франс, Париж","precision":"other","AddressDetails":{"Country":{"AddressLine":"Иль-Де-Франс, Париж","CountryNameCode":"FR","CountryName":"Франция","AdministrativeArea":{"AdministrativeAreaName":"Париж","SubAdministrativeArea":{"SubAdministrativeAreaName":"Париж"}}}}}},"description":"Иль-Де-Франс, Франция","name":"Париж","boundedBy":{"Envelope":{"lowerCorner":"2.223824 48.815727","upperCorner":"2.469792 48.902474"}},"Point":{"pos":"2.341198 48.856929"}}},{"GeoObject":{"metaDataProperty":{"GeocoderMetaData":{"kind":"area","text":"Франция, Иль-Де-Франс, Париж","precision":"other","AddressDetails":{"Country":{"AddressLine":"Иль-Де-Франс, Париж","CountryNameCode":"FR","CountryName":"Франция","AdministrativeArea":{"AdministrativeAreaName":"Иль-Де-Франс","SubAdministrativeArea":{"SubAdministrativeAreaName":"Париж"}}}}}},"description":"Иль-Де-Франс, Франция","name":"Париж","boundedBy":{"Envelope":{"lowerCorner":"2.223824 48.815727","upperCorner":"2.469792 48.902474"}},"Point":{"pos":"2.341198 48.856929"}}}]}}}"; \ No newline at end of file diff --git a/tests/.cached_responses/6364b609fe439db7a23a0c295073d3c75f9a39bd b/tests/.cached_responses/c1d00538a725d3dbb2aaaa3add8e5cc789a1aa02 similarity index 100% rename from tests/.cached_responses/6364b609fe439db7a23a0c295073d3c75f9a39bd rename to tests/.cached_responses/c1d00538a725d3dbb2aaaa3add8e5cc789a1aa02 diff --git a/tests/.cached_responses/c307fb40fcd224cbba28992874b8203f0a9da80a b/tests/.cached_responses/c307fb40fcd224cbba28992874b8203f0a9da80a deleted file mode 100644 index 3847b71e2..000000000 --- a/tests/.cached_responses/c307fb40fcd224cbba28992874b8203f0a9da80a +++ /dev/null @@ -1,100 +0,0 @@ -s:2807:"{ - "licenses" : [ - { - "name" : "CC-BY-SA", - "url" : "http://creativecommons.org/licenses/by-sa/3.0/" - }, - { - "name" : "ODbL", - "url" : "http://opendatacommons.org/licenses/odbl/summary/" - } - ], - "rate" : { - "limit" : 2500, - "remaining" : 2446, - "reset" : 1410393600 - }, - "results" : [ - { - "annotations" : { - "OSM" : { - "url" : "http://www.openstreetmap.org/?mlat=50.18906&mlon=8.63657#map=17/50.18906/8.63657" - }, - "geohash" : "u0yjs88uqx70ec4w60ur", - "timezone" : { - "name" : "Europe/Berlin", - "now_in_dst" : 1, - "offset_sec" : 7200, - "offset_string" : 200, - "short_name" : "CEST" - } - }, - "bounds" : { - "northeast" : { - "lat" : 50.1891212, - "lng" : 8.6366633 - }, - "southwest" : { - "lat" : 50.1890027, - "lng" : 8.6364707 - } - }, - "components" : { - "city" : "Frankfurt", - "city_district" : "Kalbach", - "country" : "Germany", - "country_code" : "de", - "county" : "Frankfurt", - "house_number" : 10, - "postcode" : 60437, - "road" : "Kalbacher Hauptstra\u00dfe", - "state" : "Hesse", - "state_district" : "Regierungsbezirk Darmstadt", - "suburb" : "Kalbach" - }, - "confidence" : 10, - "formatted" : "Kalbacher Hauptstra\u00dfe 10, 60437 Frankfurt, Germany", - "geometry" : { - "lat" : 50.189062, - "lng" : 8.63656700808489 - } - }, - { - "annotations" : { - "OSM" : { - "url" : "http://www.openstreetmap.org/?mlat=50.18780&mlon=8.66320#map=17/50.18780/8.66320" - }, - "geohash" : "u0yjt0km5hn07v28j4fu", - "timezone" : { - "name" : "Europe/Berlin", - "now_in_dst" : 1, - "offset_sec" : 7200, - "offset_string" : 200, - "short_name" : "CEST" - } - }, - "components" : { - "country" : "Germany", - "postal code" : 60437 - }, - "confidence" : 0, - "formatted" : "Germany, 60437", - "geometry" : { - "lat" : 50.1878, - "lng" : 8.6632 - } - } - ], - "status" : { - "code" : 200, - "message" : "OK" - }, - "thanks" : "For using an OpenCage Data API", - "timestamp" : { - "created_http" : "Wed, 10 Sep 2014 21:51:40 GMT", - "created_unix" : 1410385900 - }, - "total_results" : 2, - "we_are_hiring" : "http://lokku.com/#jobs" -} -"; \ No newline at end of file diff --git a/tests/.cached_responses/c3487c0fe92a00d80eab35b6b3c5bfe916dd11c0 b/tests/.cached_responses/c3487c0fe92a00d80eab35b6b3c5bfe916dd11c0 deleted file mode 100644 index 8b02c6609..000000000 --- a/tests/.cached_responses/c3487c0fe92a00d80eab35b6b3c5bfe916dd11c0 +++ /dev/null @@ -1 +0,0 @@ -s:96:"BR,26,Florianpolis,,-27.583300,-48.566700,0,0,"Global Village Telecom","Global Village Telecom""; \ No newline at end of file diff --git a/tests/.cached_responses/c5841aae4eeef01eabc1469c69495f04c2da175c b/tests/.cached_responses/c5841aae4eeef01eabc1469c69495f04c2da175c deleted file mode 100644 index bc2ddf7d1..000000000 --- a/tests/.cached_responses/c5841aae4eeef01eabc1469c69495f04c2da175c +++ /dev/null @@ -1,35 +0,0 @@ -s:754:" - - - - 40.707507 - -74.011255 - New York - NY - 10005 - 2 - New St - 40.707507 - -74.011255 - 0 - - - - - 40.707507 - -74.011255 - New York - NY - 10005 - 2 - New St - 40.707507 - -74.011255 - 0 - - - - - - -"; \ No newline at end of file diff --git a/tests/.cached_responses/c61162fb20c07fed396ed94540f32cc38159267c b/tests/.cached_responses/c61162fb20c07fed396ed94540f32cc38159267c deleted file mode 100644 index 97720baac..000000000 --- a/tests/.cached_responses/c61162fb20c07fed396ed94540f32cc38159267c +++ /dev/null @@ -1,69 +0,0 @@ -s:2060:"{ - "results" : [ - { - "address_components" : [ - { - "long_name" : "10", - "short_name" : "10", - "types" : [ "street_number" ] - }, - { - "long_name" : "Avenue Gambetta", - "short_name" : "Av. Gambetta", - "types" : [ "route" ] - }, - { - "long_name" : "20th arrondissement of Paris", - "short_name" : "20th arrondissement of Paris", - "types" : [ "sublocality", "political" ] - }, - { - "long_name" : "Paris", - "short_name" : "Paris", - "types" : [ "locality", "political" ] - }, - { - "long_name" : "Paris", - "short_name" : "75", - "types" : [ "administrative_area_level_2", "political" ] - }, - { - "long_name" : "Île-de-France", - "short_name" : "IDF", - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "long_name" : "France", - "short_name" : "FR", - "types" : [ "country", "political" ] - }, - { - "long_name" : "75020", - "short_name" : "75020", - "types" : [ "postal_code" ] - } - ], - "formatted_address" : "10 Avenue Gambetta, 75020 Paris, France", - "geometry" : { - "location" : { - "lat" : 48.8631203, - "lng" : 2.3887918 - }, - "location_type" : "ROOFTOP", - "viewport" : { - "northeast" : { - "lat" : 48.86446928029149, - "lng" : 2.390140780291502 - }, - "southwest" : { - "lat" : 48.8617713197085, - "lng" : 2.387442819708498 - } - } - }, - "types" : [ "street_address" ] - } - ], - "status" : "OK" -} -"; \ No newline at end of file diff --git a/tests/.cached_responses/c972187b27aae0b606ca03e34af04cf70c016b87 b/tests/.cached_responses/c972187b27aae0b606ca03e34af04cf70c016b87 deleted file mode 100644 index db711f2a3..000000000 --- a/tests/.cached_responses/c972187b27aae0b606ca03e34af04cf70c016b87 +++ /dev/null @@ -1,13 +0,0 @@ -s:294:"{ - "statusCode" : "OK", - "statusMessage" : "", - "ipAddress" : "74.125.45.100", - "countryCode" : "US", - "countryName" : "UNITED STATES", - "regionName" : "CALIFORNIA", - "cityName" : "MOUNTAIN VIEW", - "zipCode" : "94043", - "latitude" : "37.406", - "longitude" : "-122.079", - "timeZone" : "-07:00" -}"; \ No newline at end of file diff --git a/tests/.cached_responses/d1444e22b66656521510faf98ab2d984e0352d9a b/tests/.cached_responses/d1444e22b66656521510faf98ab2d984e0352d9a index 0449d0f62..aa24731d8 100644 --- a/tests/.cached_responses/d1444e22b66656521510faf98ab2d984e0352d9a +++ b/tests/.cached_responses/d1444e22b66656521510faf98ab2d984e0352d9a @@ -1,8 +1,8 @@ -s:4098:" - - -Kalbacher HauptstraßeKalbachFrankfurt am MainFrankfurt am MainRegierungsbezirk DarmstadtHessen60437Deutschlandde -Kalbacher HauptstraßeDeutsche Carbone AGBonamesFrankfurt am MainFrankfurt am MainRegierungsbezirk DarmstadtHessen60437Deutschlandde -Kalbacher HauptstraßeKalbachFrankfurt am MainFrankfurt am MainRegierungsbezirk DarmstadtHessen60437Deutschlandde -Kalbacher HauptstraßeKalbachFrankfurt am MainFrankfurt am MainRegierungsbezirk DarmstadtHessen60437Deutschlandde -Kalbacher HauptstraßeDeutsche Carbone AGBonamesFrankfurt am MainFrankfurt am MainRegierungsbezirk DarmstadtHessen60437DeutschlanddeEuropäischen Union"; \ No newline at end of file +s:4012:" + + +Kalbacher HauptstraßeKalbachKalbachFrankfurt am MainRegierungsbezirk DarmstadtHessen60437Deutschlandde +Kalbacher HauptstraßeKalbachKalbachFrankfurt am MainRegierungsbezirk DarmstadtHessen60437Deutschlandde +Kalbacher HauptstraßeKalbachKalbachFrankfurt am MainRegierungsbezirk DarmstadtHessen60437Deutschlandde +Kalbacher HauptstraßeDeutsche Carbone AGKalbachFrankfurt am MainRegierungsbezirk DarmstadtHessen60437Deutschlandde +Kalbacher HauptstraßeKalbachKalbachFrankfurt am MainRegierungsbezirk DarmstadtHessen60437Deutschlandde"; \ No newline at end of file diff --git a/tests/.cached_responses/d231745e9f80a2fabc1b38ff3787166a38877d00 b/tests/.cached_responses/d231745e9f80a2fabc1b38ff3787166a38877d00 deleted file mode 100644 index 1cf2d7430..000000000 --- a/tests/.cached_responses/d231745e9f80a2fabc1b38ff3787166a38877d00 +++ /dev/null @@ -1,425 +0,0 @@ -s:12821:"{ - "results" : [ - { - "address_components" : [ - { - "long_name" : "12", - "short_name" : "12", - "types" : [ "street_number" ] - }, - { - "long_name" : "Avenue Gambetta", - "short_name" : "Av. Gambetta", - "types" : [ "route" ] - }, - { - "long_name" : "20th arrondissement of Paris", - "short_name" : "20th arrondissement of Paris", - "types" : [ "sublocality", "political" ] - }, - { - "long_name" : "Paris", - "short_name" : "Paris", - "types" : [ "locality", "political" ] - }, - { - "long_name" : "Paris", - "short_name" : "75", - "types" : [ "administrative_area_level_2", "political" ] - }, - { - "long_name" : "Île-de-France", - "short_name" : "IDF", - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "long_name" : "France", - "short_name" : "FR", - "types" : [ "country", "political" ] - }, - { - "long_name" : "75020", - "short_name" : "75020", - "types" : [ "postal_code" ] - } - ], - "formatted_address" : "12 Avenue Gambetta, 75020 Paris, France", - "geometry" : { - "location" : { - "lat" : 48.8631282, - "lng" : 2.3889405 - }, - "location_type" : "ROOFTOP", - "viewport" : { - "northeast" : { - "lat" : 48.8644771802915, - "lng" : 2.390289480291502 - }, - "southwest" : { - "lat" : 48.8617792197085, - "lng" : 2.387591519708498 - } - } - }, - "types" : [ "street_address" ] - }, - { - "address_components" : [ - { - "long_name" : "Père-Lachaise", - "short_name" : "Père-Lachaise", - "types" : [ "neighborhood", "political" ] - }, - { - "long_name" : "Paris", - "short_name" : "Paris", - "types" : [ "locality", "political" ] - }, - { - "long_name" : "Paris", - "short_name" : "75", - "types" : [ "administrative_area_level_2", "political" ] - }, - { - "long_name" : "Île-de-France", - "short_name" : "IDF", - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "long_name" : "France", - "short_name" : "FR", - "types" : [ "country", "political" ] - } - ], - "formatted_address" : "Père-Lachaise, Paris, France", - "geometry" : { - "bounds" : { - "northeast" : { - "lat" : 48.8707461, - "lng" : 2.4064679 - }, - "southwest" : { - "lat" : 48.856442, - "lng" : 2.383115 - } - }, - "location" : { - "lat" : 48.8627872, - "lng" : 2.3928087 - }, - "location_type" : "APPROXIMATE", - "viewport" : { - "northeast" : { - "lat" : 48.8707461, - "lng" : 2.4064679 - }, - "southwest" : { - "lat" : 48.856442, - "lng" : 2.383115 - } - } - }, - "types" : [ "neighborhood", "political" ] - }, - { - "address_components" : [ - { - "long_name" : "75020", - "short_name" : "75020", - "types" : [ "postal_code" ] - }, - { - "long_name" : "Paris", - "short_name" : "Paris", - "types" : [ "locality", "political" ] - }, - { - "long_name" : "Paris", - "short_name" : "75", - "types" : [ "administrative_area_level_2", "political" ] - }, - { - "long_name" : "Île-de-France", - "short_name" : "IDF", - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "long_name" : "France", - "short_name" : "FR", - "types" : [ "country", "political" ] - } - ], - "formatted_address" : "75020 Paris, France", - "geometry" : { - "bounds" : { - "northeast" : { - "lat" : 48.8784077, - "lng" : 2.4164596 - }, - "southwest" : { - "lat" : 48.8465946, - "lng" : 2.3768622 - } - }, - "location" : { - "lat" : 48.8599825, - "lng" : 2.4066412 - }, - "location_type" : "APPROXIMATE", - "viewport" : { - "northeast" : { - "lat" : 48.8784077, - "lng" : 2.4164596 - }, - "southwest" : { - "lat" : 48.8465946, - "lng" : 2.3768622 - } - } - }, - "types" : [ "postal_code" ] - }, - { - "address_components" : [ - { - "long_name" : "20th arrondissement of Paris", - "short_name" : "20th arrondissement of Paris", - "types" : [ "sublocality", "political" ] - }, - { - "long_name" : "Paris", - "short_name" : "Paris", - "types" : [ "locality", "political" ] - }, - { - "long_name" : "Paris", - "short_name" : "75", - "types" : [ "administrative_area_level_2", "political" ] - }, - { - "long_name" : "Île-de-France", - "short_name" : "IDF", - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "long_name" : "France", - "short_name" : "FR", - "types" : [ "country", "political" ] - } - ], - "formatted_address" : "20th arrondissement of Paris, Paris, France", - "geometry" : { - "bounds" : { - "northeast" : { - "lat" : 48.8784419, - "lng" : 2.4163301 - }, - "southwest" : { - "lat" : 48.846621, - "lng" : 2.376885 - } - }, - "location" : { - "lat" : 48.8650611, - "lng" : 2.39905 - }, - "location_type" : "APPROXIMATE", - "viewport" : { - "northeast" : { - "lat" : 48.8784419, - "lng" : 2.4163301 - }, - "southwest" : { - "lat" : 48.846621, - "lng" : 2.376885 - } - } - }, - "types" : [ "sublocality", "political" ] - }, - { - "address_components" : [ - { - "long_name" : "Paris", - "short_name" : "Paris", - "types" : [ "locality", "political" ] - }, - { - "long_name" : "Paris", - "short_name" : "75", - "types" : [ "administrative_area_level_2", "political" ] - }, - { - "long_name" : "Île-de-France", - "short_name" : "IDF", - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "long_name" : "France", - "short_name" : "FR", - "types" : [ "country", "political" ] - } - ], - "formatted_address" : "Paris, France", - "geometry" : { - "bounds" : { - "northeast" : { - "lat" : 48.9021449, - "lng" : 2.4699208 - }, - "southwest" : { - "lat" : 48.815573, - "lng" : 2.224199 - } - }, - "location" : { - "lat" : 48.856614, - "lng" : 2.3522219 - }, - "location_type" : "APPROXIMATE", - "viewport" : { - "northeast" : { - "lat" : 48.9021449, - "lng" : 2.4699208 - }, - "southwest" : { - "lat" : 48.815573, - "lng" : 2.224199 - } - } - }, - "types" : [ "locality", "political" ] - }, - { - "address_components" : [ - { - "long_name" : "Paris", - "short_name" : "75", - "types" : [ "administrative_area_level_2", "political" ] - }, - { - "long_name" : "Île-de-France", - "short_name" : "IDF", - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "long_name" : "France", - "short_name" : "FR", - "types" : [ "country", "political" ] - } - ], - "formatted_address" : "Paris, France", - "geometry" : { - "bounds" : { - "northeast" : { - "lat" : 48.9021449, - "lng" : 2.4699208 - }, - "southwest" : { - "lat" : 48.815573, - "lng" : 2.224199 - } - }, - "location" : { - "lat" : 48.8763337, - "lng" : 2.3461207 - }, - "location_type" : "APPROXIMATE", - "viewport" : { - "northeast" : { - "lat" : 48.9021449, - "lng" : 2.4699208 - }, - "southwest" : { - "lat" : 48.815573, - "lng" : 2.224199 - } - } - }, - "types" : [ "administrative_area_level_2", "political" ] - }, - { - "address_components" : [ - { - "long_name" : "Île-de-France", - "short_name" : "IDF", - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "long_name" : "France", - "short_name" : "FR", - "types" : [ "country", "political" ] - } - ], - "formatted_address" : "Île-de-France, France", - "geometry" : { - "bounds" : { - "northeast" : { - "lat" : 49.241504, - "lng" : 3.5590069 - }, - "southwest" : { - "lat" : 48.1200811, - "lng" : 1.44617 - } - }, - "location" : { - "lat" : 48.8499198, - "lng" : 2.6370411 - }, - "location_type" : "APPROXIMATE", - "viewport" : { - "northeast" : { - "lat" : 49.241504, - "lng" : 3.5590069 - }, - "southwest" : { - "lat" : 48.1200811, - "lng" : 1.44617 - } - } - }, - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "address_components" : [ - { - "long_name" : "France", - "short_name" : "FR", - "types" : [ "country", "political" ] - } - ], - "formatted_address" : "France", - "geometry" : { - "bounds" : { - "northeast" : { - "lat" : 51.0889618, - "lng" : 9.560067799999999 - }, - "southwest" : { - "lat" : 41.3423276, - "lng" : -5.141227900000001 - } - }, - "location" : { - "lat" : 46.227638, - "lng" : 2.213749 - }, - "location_type" : "APPROXIMATE", - "viewport" : { - "northeast" : { - "lat" : 51.0889618, - "lng" : 9.5597934 - }, - "southwest" : { - "lat" : 41.3423276, - "lng" : -5.140402 - } - } - }, - "types" : [ "country", "political" ] - } - ], - "status" : "OK" -} -"; \ No newline at end of file diff --git a/tests/.cached_responses/d5acce58382374896160a6a9f0ffc48e1fe07d03 b/tests/.cached_responses/d5acce58382374896160a6a9f0ffc48e1fe07d03 deleted file mode 100644 index 963a7e3e2..000000000 --- a/tests/.cached_responses/d5acce58382374896160a6a9f0ffc48e1fe07d03 +++ /dev/null @@ -1,12 +0,0 @@ -s:209:"{ - "status":"OK", - "result":{ - "location":{ - "lng":116.30815, - "lat":40.056885 - }, - "precise":1, - "confidence":80, - "level":"\u9053\u8def" - } -}"; \ No newline at end of file diff --git a/tests/.cached_responses/d7947e75e249cdfc9010c23f7e752c98f0eda7f5 b/tests/.cached_responses/d7947e75e249cdfc9010c23f7e752c98f0eda7f5 index 4158ec72c..87453f65f 100644 --- a/tests/.cached_responses/d7947e75e249cdfc9010c23f7e752c98f0eda7f5 +++ b/tests/.cached_responses/d7947e75e249cdfc9010c23f7e752c98f0eda7f5 @@ -1,3 +1,3 @@ s:369:" - + "; \ No newline at end of file diff --git a/tests/.cached_responses/d7ed302d16c33755c09f2ac3998f4fdf70b95912 b/tests/.cached_responses/d7ed302d16c33755c09f2ac3998f4fdf70b95912 index 3486e51ff..37b664025 100644 --- a/tests/.cached_responses/d7ed302d16c33755c09f2ac3998f4fdf70b95912 +++ b/tests/.cached_responses/d7ed302d16c33755c09f2ac3998f4fdf70b95912 @@ -1,8 +1,8 @@ -s:3394:" - - -ParisParisÎle-de-France75000France métropolitainefrEuropean Union -ParisÎle-de-FranceFrance métropolitainefrEuropean Union -ParisLogan CountyArkansasUnited States of Americaus -ParisLamar CountyTexasUnited States of Americaus +s:3116:" + + +ParisParisÎle-de-FranceFrancefr +ParisÎle-de-FranceFrancefr +ParisLogan CountyArkansasUnited States of Americaus +ParisLamar CountyTexasUnited States of Americaus ParisBourbon CountyKentuckyUnited States of Americaus"; \ No newline at end of file diff --git a/tests/.cached_responses/dbc2472eae0fd53e95b4ab4a83a9079e2b0f6824 b/tests/.cached_responses/dbc2472eae0fd53e95b4ab4a83a9079e2b0f6824 deleted file mode 100644 index 39cdd4cde..000000000 --- a/tests/.cached_responses/dbc2472eae0fd53e95b4ab4a83a9079e2b0f6824 +++ /dev/null @@ -1 +0,0 @@ -s:13833:"{"totalResultsCount":5317,"geonames":[{"adminCode2":"GLA","alternateNames":[{"name":"Лондан","lang":"ab"},{"name":"Londen","lang":"af"},{"name":"London","lang":"als"},{"name":"ለንደን","lang":"am"},{"name":"Londres","lang":"an"},{"name":"Lunden","lang":"ang"},{"name":"لندن","lang":"ar"},{"name":"ܠܘܢܕܘܢ","lang":"arc"},{"name":"لندن","lang":"arz"},{"name":"Londres","lang":"ast"},{"name":"London","lang":"az"},{"name":"Лондон","lang":"ba"},{"name":"Londres","lang":"bcl"},{"name":"Горад Лондан","lang":"be"},{"name":"Лондон","lang":"bg"},{"name":"লন্ডন","lang":"bn"},{"name":"ལོན་ཊོན།","lang":"bo"},{"name":"Londrez","lang":"br"},{"name":"London","lang":"bs"},{"name":"Londres","lang":"ca"},{"name":"Lùng-dŭng","lang":"cdo"},{"name":"ᎫᎴ ᏗᏍᎪᏂᎯᏱ","lang":"chr"},{"name":"لەندەن","lang":"ckb"},{"name":"Londra","lang":"co"},{"name":"Londýn","lang":"cs"},{"name":"Лондонъ","lang":"cu"},{"name":"Лондон","lang":"cv"},{"name":"Llundain","lang":"cy"},{"name":"London","lang":"da"},{"name":"London","lang":"de"},{"name":"Londra","lang":"diq"},{"name":"Λονδίνο","lang":"el"},{"name":"London","lang":"en"},{"name":"Londono","lang":"eo"},{"name":"Londres","lang":"es"},{"name":"London","lang":"et"},{"name":"London","lang":"eu"},{"name":"Londri","lang":"ext"},{"name":"لندن","lang":"fa"},{"name":"Lontoo","lang":"fi"},{"name":"Londres","lang":"fr"},{"name":"Londres","lang":"frp"},{"name":"Londen","lang":"fy"},{"name":"Londain","lang":"ga"},{"name":"倫敦","lang":"gan"},{"name":"Lunnainn","lang":"gd"},{"name":"Londres","lang":"gl"},{"name":"Londye","lang":"gn"},{"name":"લંડન","lang":"gu"},{"name":"Lunnin","lang":"gv"},{"name":"Lākana","lang":"haw"},{"name":"London","lang":"hbs"},{"name":"לונדון","lang":"he"},{"name":"लंदन","lang":"hi"},{"name":"London","lang":"hr"},{"name":"Lonn","lang":"ht"},{"name":"London","lang":"hu"},{"name":"Լոնդոն","lang":"hy"},{"name":"London","lang":"ia"},{"name":"LON","lang":"iata"},{"name":"London","lang":"id"},{"name":"Londres","lang":"ilo"},{"name":"London","lang":"io"},{"name":"Lundúnir","lang":"is"},{"name":"Londra","lang":"it"},{"name":"ロンドン","lang":"ja"},{"name":"london","lang":"jbo"},{"name":"ლონდონი","lang":"ka"},{"name":"Лондон","lang":"kk"},{"name":"ಲಂಡನ್","lang":"kn"},{"name":"런던","lang":"ko"},{"name":"Лондон","lang":"koi"},{"name":"Лондон","lang":"krc"},{"name":"London","lang":"ku"},{"name":"Лондон","lang":"kv"},{"name":"Loundres","lang":"kw"},{"name":"Лондон","lang":"ky"},{"name":"Londinium","lang":"la"},{"name":"Londra","lang":"lad"},{"name":"London","lang":"lb"},{"name":"Лондон","lang":"lbe"},{"name":"Лондон","lang":"lez"},{"name":"Londe","lang":"li"},{"name":"Londra","lang":"lij"},{"name":"http://en.wikipedia.org/wiki/London","lang":"link"},{"name":"Lundra","lang":"lmo"},{"name":"Londoni","lang":"ln"},{"name":"ລອນດອນ","lang":"lo"},{"name":"Londonas","lang":"lt"},{"name":"Londona","lang":"lv"},{"name":"Лондон","lang":"mhr"},{"name":"Rānana","lang":"mi"},{"name":"Лондон","lang":"mk"},{"name":"ലണ്ടൻ","lang":"ml"},{"name":"Лондон","lang":"mn"},{"name":"लंडन","lang":"mr"},{"name":"Лондон","lang":"mrj"},{"name":"London","lang":"ms"},{"name":"Londra","lang":"mt"},{"name":"Londres","lang":"mwl"},{"name":"လန်ဒန်မြို့","lang":"my"},{"name":"لندن","lang":"mzn"},{"name":"Londres","lang":"nah"},{"name":"Londra","lang":"nap"},{"name":"London","lang":"nds"},{"name":"लण्डन","lang":"ne"},{"name":"लण्डन","lang":"new"},{"name":"Londen","lang":"nl"},{"name":"London","lang":"nn"},{"name":"London","lang":"no"},{"name":"Londres","lang":"nrm"},{"name":"Londres","lang":"oc"},{"name":"ଲଣ୍ଡନ","lang":"or"},{"name":"Лондон","lang":"os"},{"name":"Londe","lang":"pcd"},{"name":"Londyn","lang":"pl"},{"name":"Londra","lang":"pms"},{"name":"لندن","lang":"pnb"},{"name":"Λονδίνο","lang":"pnt"},{"name":"لندن","lang":"ps"},{"name":"Londres","lang":"pt"},{"name":"London","lang":"qu"},{"name":"Londra","lang":"rm"},{"name":"Londra","lang":"ro"},{"name":"Лондон","lang":"ru"},{"name":"Лондон","lang":"rue"},{"name":"लन्डन्","lang":"sa"},{"name":"Лондон","lang":"sah"},{"name":"Londra","lang":"sc"},{"name":"Londra","lang":"scn"},{"name":"Lunnon","lang":"sco"},{"name":"ලන්ඩන්","lang":"si"},{"name":"Londýn","lang":"sk"},{"name":"London","lang":"sl"},{"name":"Londra","lang":"sq"},{"name":"Лондон","lang":"sr"},{"name":"London","lang":"sv"},{"name":"Lůndůn","lang":"szl"},{"name":"இலண்டன்","lang":"ta"},{"name":"లండన్","lang":"te"},{"name":"Londres","lang":"tet"},{"name":"Лондон","lang":"tg"},{"name":"ลอนดอน","lang":"th"},{"name":"Londres","lang":"tl"},{"name":"Landen","lang":"tpi"},{"name":"Londra","lang":"tr"},{"name":"Лондон","lang":"tt"},{"name":"Лондон","lang":"udm"},{"name":"لوندون","lang":"ug"},{"name":"Лондон","lang":"uk"},{"name":"لندن","lang":"ur"},{"name":"Łondra","lang":"vec"},{"name":"Luân Đôn","lang":"vi"},{"name":"Londn","lang":"vls"},{"name":"London","lang":"vo"},{"name":"Londar","lang":"wo"},{"name":"伦敦","lang":"wuu"},{"name":"ლონდონი","lang":"xmf"},{"name":"לאנדאן","lang":"yi"},{"name":"Lọndọnu","lang":"yo"},{"name":"Londen","lang":"zea"},{"name":"伦敦","lang":"zh"},{"name":"伦敦","lang":"zh-CN"},{"name":"ILondon","lang":"zu"}],"countryName":"Regno Unito","adminCode1":"ENG","score":129.77806091308594,"lng":"-0.12574","adminName2":"Greater London","fcodeName":"capital of a political entity","adminName3":"","timezone":{"dstOffset":1,"gmtOffset":0,"timeZoneId":"Europe/London"},"adminName4":"","adminName5":"","bbox":{"south":51.15168939834484,"east":0.45212493672385795,"north":51.865368153380956,"west":-0.7036088539601859},"name":"Londra","fcode":"PPLC","geonameId":2643743,"lat":"51.50853","population":7556900,"adminName1":"Inghilterra","adminId1":"6269131","countryId":"2635167","fclName":"city, village,...","countryCode":"GB","adminId2":"2648110","wikipediaURL":"","toponymName":"London","fcl":"P","continentCode":"EU"},{"adminCode3":"BUF","adminCode2":"BUF","alternateNames":[{"name":"Oos Londen","lang":"af"},{"name":"Горад Іст-Лондан","lang":"be"},{"name":"Източен Лондон","lang":"bg"},{"name":"East London","lang":"da"},{"name":"East London","lang":"en"},{"name":"Orient-Londono","lang":"eo"},{"name":"East London","lang":"fi"},{"name":"East London","lang":"fr"},{"name":"איסט לונדון","lang":"he"},{"name":"ELS","lang":"iata"},{"name":"East London","lang":"id"},{"name":"イースト・ロンドン","lang":"ja"},{"name":"이스트런던","lang":"ko"},{"name":"Londinium Orientale","lang":"la"},{"name":"http://en.wikipedia.org/wiki/East_London%2C_Eastern_Cape","lang":"link"},{"name":"Yst Londonas","lang":"lt"},{"name":"ईस्ट लंडन","lang":"mr"},{"name":"Oost-Londen","lang":"nl"},{"name":"East London","lang":"pl"},{"name":"ایسٹ لندن","lang":"pnb"},{"name":"Ист-Лондон","lang":"ru"},{"name":"Источни Лондон","lang":"sr"},{"name":"Іст-Лондон","lang":"uk"},{"name":"ELS","lang":"unlc"},{"name":"東倫敦","lang":"zh"}],"countryName":"Sudafrica","adminCode1":"05","cc2":"ZA","score":60.44468688964844,"lng":"27.91162","adminName2":"Buffalo City Metropolitan Municipality","fcodeName":"seat of a second-order administrative division","adminName3":"Buffalo City","timezone":{"dstOffset":2,"gmtOffset":2,"timeZoneId":"Africa/Johannesburg"},"adminName4":"","adminName5":"","bbox":{"south":-33.10499645800343,"east":28.018503381239466,"north":-32.92557372892517,"west":27.804746435655137},"name":"East London","fcode":"PPLA2","geonameId":1006984,"lat":"-33.01529","population":478676,"adminName1":"Eastern Cape","adminId1":"1085593","countryId":"953987","fclName":"city, village,...","countryCode":"ZA","adminId3":"8347472","adminId2":"8347340","wikipediaURL":"","toponymName":"East London","fcl":"P","continentCode":"AF"},{"adminCode3":"H9","adminCode2":"GLA","alternateNames":[{"name":"مدينة لندن","lang":"ar"},{"name":"Сіці","lang":"be"},{"name":"Сити","lang":"bg"},{"name":"Kêr Londrez","lang":"br"},{"name":"La City","lang":"ca"},{"name":"Dakbayan sa Londres","lang":"ceb"},{"name":"City","lang":"cs"},{"name":"Dinas Llundain","lang":"cy"},{"name":"Σίτι του Λονδίνου","lang":"el"},{"name":"City","lang":"eo"},{"name":"City de Londres","lang":"es"},{"name":"سیتی لندن","lang":"fa"},{"name":"Lontoon City","lang":"fi"},{"name":"Cité de Londres","lang":"fr"},{"name":"Cathair Londan","lang":"ga"},{"name":"Cidade de Londres","lang":"gl"},{"name":"הסיטי של לונדון","lang":"he"},{"name":"सिटी ऑफ़ लंदन","lang":"hi"},{"name":"Լոնդոնյան Սիթի","lang":"hy"},{"name":"Lundúnaborg","lang":"is"},{"name":"Città di Londra","lang":"it"},{"name":"シティ・オブ・ロンドン","lang":"ja"},{"name":"시티오브런던","lang":"ko"},{"name":"Urbs Londiniensis","lang":"la"},{"name":"http://en.wikipedia.org/wiki/City_of_London","lang":"link"},{"name":"Londono Sitis","lang":"lt"},{"name":"Londonas Sitija","lang":"lv"},{"name":"सिटी ऑफ लंडन","lang":"mr"},{"name":"Bandaraya London","lang":"ms"},{"name":"لندن شہر","lang":"pnb"},{"name":"Cidade de Londres","lang":"pt"},{"name":"Сити","lang":"ru"},{"name":"Ceety o Lunnon","lang":"sco"},{"name":"Град Лондон","lang":"sr"},{"name":"นครลอนดอน","lang":"th"},{"name":"Lungsod ng Londres","lang":"tl"},{"name":"Londra Şehri","lang":"tr"},{"name":"Лондонське Сіті","lang":"uk"},{"name":"Thành phố Luân Đôn","lang":"vi"},{"name":"London","lang":"war"},{"name":"סיטי פון לאנדאן","lang":"yi"},{"name":"倫敦市","lang":"zh"},{"name":"Idolobha weLondon","lang":"zu"}],"countryName":"Regno Unito","adminCode1":"ENG","score":52.85734558105469,"lng":"-0.09184","adminName2":"Greater London","fcodeName":"seat of a third-order administrative division","adminName3":"City of London","timezone":{"dstOffset":1,"gmtOffset":0,"timeZoneId":"Europe/London"},"adminName4":"","adminName5":"","bbox":{"south":51.15594951276414,"east":0.48608279418977673,"north":51.86962826782626,"west":-0.6697604675296205},"name":"Città di Londra","fcode":"PPLA3","geonameId":2643741,"lat":"51.51279","population":7556900,"adminName1":"Inghilterra","adminId1":"6269131","countryId":"2635167","fclName":"city, village,...","countryCode":"GB","adminId3":"2643744","adminId2":"2648110","wikipediaURL":"","toponymName":"City of London","fcl":"P","continentCode":"EU"},{"alternateNames":[{"name":"لندن","lang":"ar"},{"name":"London","lang":"de"},{"name":"London","lang":"en"},{"name":"Londono","lang":"eo"},{"name":"London","lang":"es"},{"name":"London","lang":"et"},{"name":"لندن، انتاریو","lang":"fa"},{"name":"London","lang":"fi"},{"name":"London","lang":"fr"},{"name":"לונדון","lang":"he"},{"name":"YXU","lang":"iata"},{"name":"ロンドン","lang":"ja"},{"name":"ლონდონი","lang":"ka"},{"name":"런던","lang":"ko"},{"name":"http://en.wikipedia.org/wiki/London%2C_Ontario","lang":"link"},{"name":"Londonas","lang":"lt"},{"name":"London","lang":"nl"},{"name":"Лондон","lang":"os"},{"name":"London","lang":"pl"},{"name":"لندن","lang":"pnb"},{"name":"London","lang":"pt"},{"name":"Лондон","lang":"ru"},{"name":"Лондон","lang":"sr"},{"name":"Лондон","lang":"uk"},{"name":"LOD","lang":"unlc"},{"name":"لندن، اونٹاریو","lang":"ur"},{"name":"伦敦","lang":"zh"},{"name":"伦敦","lang":"zh-CN"}],"countryName":"Canada","adminCode1":"08","score":51.809730529785156,"lng":"-81.23304","adminName2":"","fcodeName":"populated place","adminName3":"","timezone":{"dstOffset":-4,"gmtOffset":-5,"timeZoneId":"America/Toronto"},"adminName4":"","adminName5":"","bbox":{"south":42.907075642763076,"east":-81.12859509753737,"north":43.05970292323693,"west":-81.33748967646262},"name":"London","fcode":"PPL","geonameId":6058560,"lat":"42.98339","population":346765,"adminName1":"Ontario","countryId":"6251999","adminId1":"6093943","fclName":"city, village,...","countryCode":"CA","wikipediaURL":"","toponymName":"London","fcl":"P","continentCode":"NA"},{"adminCode2":"011","alternateNames":[{"name":"Ню Лъндън","lang":"bg"},{"name":"Nova Londres","lang":"ca"},{"name":"Llundain Newydd","lang":"cy"},{"name":"ニューロンドン","lang":"ja"},{"name":"Нью Лондон","lang":"kk"},{"name":"뉴런던","lang":"ko"},{"name":"http://en.wikipedia.org/wiki/New_London%2C_Connecticut","lang":"link"},{"name":"न्यू लंडन","lang":"mr"},{"name":"06320","lang":"post"},{"name":"Нью-Лондон","lang":"ru"},{"name":"Њу Лондон","lang":"sr"},{"name":"Нью-Лондон","lang":"uk"},{"name":"NLO","lang":"unlc"},{"name":"新伦敦","lang":"zh"}],"countryName":"Stati Uniti","adminCode1":"CT","score":31.414264678955078,"lng":"-72.09952","adminName2":"Contea di New London","fcodeName":"populated place","adminName3":"","timezone":{"dstOffset":-4,"gmtOffset":-5,"timeZoneId":"America/New_York"},"adminName4":"","adminName5":"","bbox":{"south":41.334087887904154,"east":-72.07078054515445,"north":41.377219912095846,"west":-72.12826125484555},"name":"New London","fcode":"PPL","geonameId":4839416,"lat":"41.35565","population":27620,"adminName1":"Connecticut","adminId1":"4831725","countryId":"6252001","fclName":"city, village,...","elevation":17,"countryCode":"US","adminId2":"4839420","wikipediaURL":"","toponymName":"New London","fcl":"P","continentCode":"NA"}]}"; \ No newline at end of file diff --git a/tests/.cached_responses/dbef79f429e3074bdda011e1980502694ec767fb b/tests/.cached_responses/dbef79f429e3074bdda011e1980502694ec767fb deleted file mode 100644 index 882b8b138..000000000 --- a/tests/.cached_responses/dbef79f429e3074bdda011e1980502694ec767fb +++ /dev/null @@ -1 +0,0 @@ -s:822:"{"results":[{"locations":[{"latLng":{"lng":8.636567,"lat":50.189062},"adminArea4":"Frankfurt am Main","adminArea5Type":"City","adminArea4Type":"County","adminArea5":"Frankfurt","street":"Kalbacher Hauptstraße 10","adminArea1":"DE","adminArea3":"Hesse","type":"s","displayLatLng":{"lng":8.636567,"lat":50.189062},"linkId":0,"postalCode":"60437","sideOfStreet":"N","dragPoint":false,"adminArea1Type":"Country","geocodeQuality":"POINT","geocodeQualityCode":"P1XXA","adminArea3Type":"State"}],"providedLocation":{"location":"Kalbacher Hauptstraße 10, 60437 Frankfurt, Germany"}}],"options":{"ignoreLatLngInput":false,"maxResults":5,"thumbMaps":false},"info":{"copyright":{"text":"© 2013 MapQuest, Inc.","imageUrl":"http://api.mqcdn.com/res/mqlogo.gif","imageAltText":"© 2013 MapQuest, Inc."},"statuscode":0,"messages":[]}}"; \ No newline at end of file diff --git a/tests/.cached_responses/e0459136e9e4437af8bac88a11ce7be70c4e2d59 b/tests/.cached_responses/e0459136e9e4437af8bac88a11ce7be70c4e2d59 deleted file mode 100644 index d3019755c..000000000 --- a/tests/.cached_responses/e0459136e9e4437af8bac88a11ce7be70c4e2d59 +++ /dev/null @@ -1 +0,0 @@ -s:1397:"{"found": 1, "bounds": [[48.70804, 2.12785], [49.00442, 2.57701]], "features": [{"id": 1859412,"centroid": {"type":"POINT","coordinates":[48.85645, 2.35243]},"bounds": [[48.70804, 2.12785], [49.00442, 2.57701]],"properties": {"is_capital": "France", "name:ko": "파리 시", "name:ar": "باريس", "name:cs": "Paříž", "rank": "0", "name:is": "París", "name:it": "Parigi", "osm_id": "17807753", "name:nl": "Parijs", "name:pl": "Paryż", "name:ca": "París", "is_in": "France, Europe, Île de France, Paris", "name:vi": "Paris", "name:fa": "پاریس", "is_in:country": "France", "name:fi": "Pariisi", "wikipedia": "Paris", "capital": "yes", "name:fy": "Parys", "name:zh": "巴黎", "name:sl": "Pariz", "name:lv": "Parīze", "name:ja": "パリ", "name:he": "פריז", "name:sk": "Paríž", "name:uk": "Париж", "name:ru": "Париж", "name:sv": "Paris", "name:hu": "Párizs", "name:hr": "Pariz", "name:sr": "Париз", "population": "2193030", "name:el": "Παρίσι", "name:eo": "Parizo", "name": "Paris", "name:zh_pinyin": "Bālí", "place": "city", "name:gv": "Paarys", "osm_element": "node", "name:eu": "Paris", "name:et": "Pariis", "is_in:continent": "Europe", "name:es": "París"},"location": {"county": "Ile-del-france", "country": "France"},"type": "Feature"}], "type": "FeatureCollection", "crs": {"type": "EPSG", "properties": {"code": 4326, "coordinate_order": [0, 1]}}}"; \ No newline at end of file diff --git a/tests/.cached_responses/fd67cf38c744900c2fbaff37ee04f5cbd04a9345 b/tests/.cached_responses/e2294089df3badb1749aeb75f2d34e457d340523 similarity index 68% rename from tests/.cached_responses/fd67cf38c744900c2fbaff37ee04f5cbd04a9345 rename to tests/.cached_responses/e2294089df3badb1749aeb75f2d34e457d340523 index dd0c2915b..c362b2907 100644 --- a/tests/.cached_responses/fd67cf38c744900c2fbaff37ee04f5cbd04a9345 +++ b/tests/.cached_responses/e2294089df3badb1749aeb75f2d34e457d340523 @@ -3,9 +3,9 @@ s:294:"{ "statusMessage" : "", "ipAddress" : "74.125.45.100", "countryCode" : "US", - "countryName" : "UNITED STATES", - "regionName" : "CALIFORNIA", - "cityName" : "MOUNTAIN VIEW", + "countryName" : "United States", + "regionName" : "California", + "cityName" : "Mountain View", "zipCode" : "94043", "latitude" : "37.406", "longitude" : "-122.079", diff --git a/tests/.cached_responses/e5916045d0969dfeae7695f420e25b7aa25a8ab1 b/tests/.cached_responses/e5916045d0969dfeae7695f420e25b7aa25a8ab1 deleted file mode 100644 index 41b9fd25a..000000000 --- a/tests/.cached_responses/e5916045d0969dfeae7695f420e25b7aa25a8ab1 +++ /dev/null @@ -1 +0,0 @@ -s:79:"US,UT,Provo,84606,40.218102,-111.613297,770,801,"Unified Layer","Unified Layer""; \ No newline at end of file diff --git a/tests/.cached_responses/e87d8c9a4e4b632a9125ce6378e5271b6da57b0b b/tests/.cached_responses/e87d8c9a4e4b632a9125ce6378e5271b6da57b0b deleted file mode 100644 index d0ceeb87e..000000000 --- a/tests/.cached_responses/e87d8c9a4e4b632a9125ce6378e5271b6da57b0b +++ /dev/null @@ -1,11 +0,0 @@ -s:296:" - - - 009 - The latitude and longitude you provided are not in the valid range. - - 1 - -2 - - -"; \ No newline at end of file diff --git a/tests/.cached_responses/eb8f398c5fe9b5bfa00e1611560b695ca8f4eb66 b/tests/.cached_responses/eb8f398c5fe9b5bfa00e1611560b695ca8f4eb66 deleted file mode 100644 index 10f05686b..000000000 --- a/tests/.cached_responses/eb8f398c5fe9b5bfa00e1611560b695ca8f4eb66 +++ /dev/null @@ -1,69 +0,0 @@ -s:2040:"{ - "results" : [ - { - "address_components" : [ - { - "long_name" : "10", - "short_name" : "10", - "types" : [ "street_number" ] - }, - { - "long_name" : "Avenue Gambetta", - "short_name" : "Av. Gambetta", - "types" : [ "route" ] - }, - { - "long_name" : "20e Arrondissement", - "short_name" : "20e Arrondissement", - "types" : [ "sublocality", "political" ] - }, - { - "long_name" : "Paris", - "short_name" : "Paris", - "types" : [ "locality", "political" ] - }, - { - "long_name" : "Paris", - "short_name" : "75", - "types" : [ "administrative_area_level_2", "political" ] - }, - { - "long_name" : "Île-de-France", - "short_name" : "IDF", - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "long_name" : "France", - "short_name" : "FR", - "types" : [ "country", "political" ] - }, - { - "long_name" : "75020", - "short_name" : "75020", - "types" : [ "postal_code" ] - } - ], - "formatted_address" : "10 Avenue Gambetta, 75020 Paris, France", - "geometry" : { - "location" : { - "lat" : 48.8631203, - "lng" : 2.3887918 - }, - "location_type" : "ROOFTOP", - "viewport" : { - "northeast" : { - "lat" : 48.86446928029149, - "lng" : 2.390140780291502 - }, - "southwest" : { - "lat" : 48.8617713197085, - "lng" : 2.387442819708498 - } - } - }, - "types" : [ "street_address" ] - } - ], - "status" : "OK" -} -"; \ No newline at end of file diff --git a/tests/.cached_responses/ee00f7c2fd65e8e92f665093c5c2b81cb49a3bd6 b/tests/.cached_responses/ee00f7c2fd65e8e92f665093c5c2b81cb49a3bd6 deleted file mode 100644 index ebeaae03f..000000000 --- a/tests/.cached_responses/ee00f7c2fd65e8e92f665093c5c2b81cb49a3bd6 +++ /dev/null @@ -1,19 +0,0 @@ -s:521:"{ - "status":"OK", - "result":{ - "location":{ - "lng":116.322987, - "lat":39.983424 - }, - "formatted_address":"北京市海淀区中关村大街27号1101-08室", - "business":"人民大学,中关村,苏州街", - "addressComponent":{ - "city":"北京市", - "district":"海淀区", - "province":"北京市", - "street":"中关村大街", - "street_number":"27号1101-08室" - }, - "cityCode":131 - } -}"; \ No newline at end of file diff --git a/tests/.cached_responses/f0553f89054916e8c2104cb4acf3595417e9716a b/tests/.cached_responses/f0553f89054916e8c2104cb4acf3595417e9716a deleted file mode 100644 index 2f224a5cf..000000000 --- a/tests/.cached_responses/f0553f89054916e8c2104cb4acf3595417e9716a +++ /dev/null @@ -1,14 +0,0 @@ -s:276:"{ - "81.220.239.218": { - "dma_code": 0, - "latitude": 45.75, - "country_code3": "FRA", - "area_code": 0, - "longitude": 4.84999990463257, - "country_name": "France", - "postal_code": "", - "region": "B9", - "locality": "Lyon", - "country_code": "FR" - } -}"; \ No newline at end of file diff --git a/tests/.cached_responses/f5c2c376bcb725d2d715f659951cadf2043da287 b/tests/.cached_responses/f5c2c376bcb725d2d715f659951cadf2043da287 index a3839cc59..ad386f3a2 100644 --- a/tests/.cached_responses/f5c2c376bcb725d2d715f659951cadf2043da287 +++ b/tests/.cached_responses/f5c2c376bcb725d2d715f659951cadf2043da287 @@ -1 +1,3 @@ -s:223:"Unable to authenticate the request. Provided 'signature' is not valid for the provided client ID, or the provided 'client' is not valid. Learn more: https://developers.google.com/maps/documentation/business/webservices/auth"; \ No newline at end of file +s:473:"Unable to authenticate the request. Provided 'signature' is not valid for the provided client ID, or the provided 'client' is not valid. +The signature was checked against the URL: /maps/api/geocode/json?address=Columbia%20University&client=foo&signature=9dJq1hPF7_iwafUpnqXUqEkP0gY= +If this does not match the URL you requested, please ensure that your request is URL encoded correctly. Learn more: https://developers.google.com/maps/documentation/business/webservices/auth"; \ No newline at end of file diff --git a/tests/.cached_responses/f5d2e0cbbeedb1628cb53a37ff06416e636d367d b/tests/.cached_responses/f5d2e0cbbeedb1628cb53a37ff06416e636d367d deleted file mode 100644 index d9d36c2ed..000000000 --- a/tests/.cached_responses/f5d2e0cbbeedb1628cb53a37ff06416e636d367d +++ /dev/null @@ -1,4 +0,0 @@ -s:280:" - -2.56.0.0 - 2.59.255.255UA 50.45000130.523333 -"; \ No newline at end of file diff --git a/tests/.cached_responses/fd8ebeaaba96a9f801a70a96d33b7a6908b8a9ad b/tests/.cached_responses/fd8ebeaaba96a9f801a70a96d33b7a6908b8a9ad deleted file mode 100644 index 80487e7fb..000000000 --- a/tests/.cached_responses/fd8ebeaaba96a9f801a70a96d33b7a6908b8a9ad +++ /dev/null @@ -1,11 +0,0 @@ -s:263:" - - - 003 - Authentication token: bad-api-key not found. - - - - - - -"; \ No newline at end of file diff --git a/tests/.cached_responses/fdc140c25fa42d21dac27f6e9a389d7695a64b78 b/tests/.cached_responses/fdc140c25fa42d21dac27f6e9a389d7695a64b78 deleted file mode 100644 index 13ebb3425..000000000 --- a/tests/.cached_responses/fdc140c25fa42d21dac27f6e9a389d7695a64b78 +++ /dev/null @@ -1,59 +0,0 @@ -s:1634:"{ - "results" : [ - { - "address_components" : [ - { - "long_name" : "Paris", - "short_name" : "Paris", - "types" : [ "locality", "political" ] - }, - { - "long_name" : "Paris", - "short_name" : "75", - "types" : [ "administrative_area_level_2", "political" ] - }, - { - "long_name" : "Île-de-France", - "short_name" : "IDF", - "types" : [ "administrative_area_level_1", "political" ] - }, - { - "long_name" : "France", - "short_name" : "FR", - "types" : [ "country", "political" ] - } - ], - "formatted_address" : "Paris, France", - "geometry" : { - "bounds" : { - "northeast" : { - "lat" : 48.9021449, - "lng" : 2.4699208 - }, - "southwest" : { - "lat" : 48.815573, - "lng" : 2.224199 - } - }, - "location" : { - "lat" : 48.856614, - "lng" : 2.3522219 - }, - "location_type" : "APPROXIMATE", - "viewport" : { - "northeast" : { - "lat" : 48.9021449, - "lng" : 2.4699208 - }, - "southwest" : { - "lat" : 48.815573, - "lng" : 2.224199 - } - } - }, - "types" : [ "locality", "political" ] - } - ], - "status" : "OK" -} -"; \ No newline at end of file diff --git a/tests/.cached_responses/48f20f73811a6fb236311b5e3f9d9ca044549f80 b/tests/.cached_responses/ff149227816fd8aa631f7bb4adc09725bc839493 similarity index 77% rename from tests/.cached_responses/48f20f73811a6fb236311b5e3f9d9ca044549f80 rename to tests/.cached_responses/ff149227816fd8aa631f7bb4adc09725bc839493 index ded8795c4..b596e531f 100644 --- a/tests/.cached_responses/48f20f73811a6fb236311b5e3f9d9ca044549f80 +++ b/tests/.cached_responses/ff149227816fd8aa631f7bb4adc09725bc839493 @@ -3,5 +3,5 @@ s:136:"{ "statusMessage" : "", "ipAddress" : "74.125.45.100", "countryCode" : "US", - "countryName" : "UNITED STATES" + "countryName" : "United States" }"; \ No newline at end of file diff --git a/tests/Geocoder/Tests/CachedResponseAdapter.php b/tests/Geocoder/Tests/CachedResponseAdapter.php index ee95bbb84..25d303e2a 100644 --- a/tests/Geocoder/Tests/CachedResponseAdapter.php +++ b/tests/Geocoder/Tests/CachedResponseAdapter.php @@ -14,14 +14,17 @@ class CachedResponseAdapter extends AbstractHttpAdapter private $useCache; + private $apiKey; + private $cacheDir; - public function __construct(HttpAdapterInterface $adapter, $useCache = false, $cacheDir = '.cached_responses') + public function __construct(HttpAdapterInterface $adapter, $useCache = false, $apiKey, $cacheDir = '.cached_responses') { parent::__construct(); $this->adapter = $adapter; $this->useCache = $useCache; + $this->apiKey = $apiKey; $this->cacheDir = $cacheDir; } @@ -38,7 +41,11 @@ public function getName() */ protected function doSend(InternalRequestInterface $internalRequest) { - $file = sprintf('%s/%s/%s', realpath(__DIR__ . '/../../'), $this->cacheDir, sha1($internalRequest->getUrl())); + $url = $internalRequest->getUrl(); + if ($this->apiKey) { + $url = str_replace($this->apiKey, '[apikey]', $url); + } + $file = sprintf('%s/%s/%s', realpath(__DIR__ . '/../../'), $this->cacheDir, sha1($url)); if ($this->useCache && is_file($file) && is_readable($file)) { $content = unserialize(file_get_contents($file)); diff --git a/tests/Geocoder/Tests/Provider/BingMapsTest.php b/tests/Geocoder/Tests/Provider/BingMapsTest.php index fb46456e7..9f0b3e2c6 100644 --- a/tests/Geocoder/Tests/Provider/BingMapsTest.php +++ b/tests/Geocoder/Tests/Provider/BingMapsTest.php @@ -196,7 +196,7 @@ public function testGeocodeWithRealAddressReturnsSingleResults() $this->markTestSkipped('You need to configure the BINGMAPS_API_KEY value in phpunit.xml'); } - $provider = new BingMaps($this->getAdapter(), $_SERVER['BINGMAPS_API_KEY'], 'fr-FR'); + $provider = new BingMaps($this->getAdapter($_SERVER['BINGMAPS_API_KEY']), $_SERVER['BINGMAPS_API_KEY'], 'fr-FR'); $results = $provider->geocode('10 avenue Gambetta, Paris, France'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -234,7 +234,7 @@ public function testGeocodeWithRealAddressReturnsMultipleResults() $this->markTestSkipped('You need to configure the BINGMAPS_API_KEY value in phpunit.xml'); } - $provider = new BingMaps($this->getAdapter(), $_SERVER['BINGMAPS_API_KEY'], 'fr-FR'); + $provider = new BingMaps($this->getAdapter($_SERVER['BINGMAPS_API_KEY']), $_SERVER['BINGMAPS_API_KEY'], 'fr-FR'); $results = $provider->geocode('Castelnuovo, Italie'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -362,7 +362,7 @@ public function testReverseWithRealCoordinatesReturnsSingleResult() $this->markTestSkipped('You need to configure the BINGMAPS_API_KEY value in phpunit.xml'); } - $provider = new BingMaps($this->getAdapter(), $_SERVER['BINGMAPS_API_KEY']); + $provider = new BingMaps($this->getAdapter($_SERVER['BINGMAPS_API_KEY']), $_SERVER['BINGMAPS_API_KEY']); $results = $provider->reverse(48.86321648955345, 2.3887719959020615); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -401,7 +401,7 @@ public function testGeocodeWithRealIPv4() $this->markTestSkipped('You need to configure the BINGMAPS_API_KEY value in phpunit.xml'); } - $provider = new BingMaps($this->getAdapter(), $_SERVER['BINGMAPS_API_KEY']); + $provider = new BingMaps($this->getAdapter($_SERVER['BINGMAPS_API_KEY']), $_SERVER['BINGMAPS_API_KEY']); $provider->geocode('88.188.221.14'); } @@ -415,7 +415,7 @@ public function testGeocodeWithRealIPv6() $this->markTestSkipped('You need to configure the BINGMAPS_API_KEY value in phpunit.xml'); } - $provider = new BingMaps($this->getAdapter(), $_SERVER['BINGMAPS_API_KEY']); + $provider = new BingMaps($this->getAdapter($_SERVER['BINGMAPS_API_KEY']), $_SERVER['BINGMAPS_API_KEY']); $provider->geocode('::ffff:88.188.221.14'); } } diff --git a/tests/Geocoder/Tests/Provider/FreeGeoIpTest.php b/tests/Geocoder/Tests/Provider/FreeGeoIpTest.php index 2887b49ae..934be9258 100644 --- a/tests/Geocoder/Tests/Provider/FreeGeoIpTest.php +++ b/tests/Geocoder/Tests/Provider/FreeGeoIpTest.php @@ -176,9 +176,7 @@ public function testGeocodeWithUKIPv4() $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); $this->assertCount(1, $results); - - $this->assertCount(1, $results->first()->getAdminLevels()); - $this->assertEquals('H9', $results->first()->getAdminLevels()->get(1)->getCode()); + $this->assertEquals('GB', $results->first()->getCountry()->getCode()); } public function testGeocodeWithUKIPv6() @@ -188,9 +186,7 @@ public function testGeocodeWithUKIPv6() $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); $this->assertCount(1, $results); - - $this->assertCount(1, $results->first()->getAdminLevels()); - $this->assertEquals('H9', $results->first()->getAdminLevels()->get(1)->getCode()); + $this->assertEquals('GB', $results->first()->getCountry()->getCode()); } /** diff --git a/tests/Geocoder/Tests/Provider/GeoIPsTest.php b/tests/Geocoder/Tests/Provider/GeoIPsTest.php index 873c0de17..9d1f3e0aa 100644 --- a/tests/Geocoder/Tests/Provider/GeoIPsTest.php +++ b/tests/Geocoder/Tests/Provider/GeoIPsTest.php @@ -327,7 +327,7 @@ public function testGeocodeWithRealIPv4() $this->markTestSkipped('You need to configure the GEOIPS_API_KEY value in phpunit.xml'); } - $provider = new GeoIPs($this->getAdapter(), $_SERVER['GEOIPS_API_KEY']); + $provider = new GeoIPs($this->getAdapter($_SERVER['GEOIPS_API_KEY']), $_SERVER['GEOIPS_API_KEY']); $results = $provider->geocode('66.147.244.214'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -359,7 +359,7 @@ public function testGeocodeWithRealIPv4NoResults() $this->markTestSkipped('You need to configure the GEOIPS_API_KEY value in phpunit.xml'); } - $provider = new GeoIPs($this->getAdapter(), $_SERVER['GEOIPS_API_KEY']); + $provider = new GeoIPs($this->getAdapter($_SERVER['GEOIPS_API_KEY']), $_SERVER['GEOIPS_API_KEY']); $provider->geocode('255.255.150.96'); } diff --git a/tests/Geocoder/Tests/Provider/GeonamesTest.php b/tests/Geocoder/Tests/Provider/GeonamesTest.php index fbde84629..d54cedf18 100644 --- a/tests/Geocoder/Tests/Provider/GeonamesTest.php +++ b/tests/Geocoder/Tests/Provider/GeonamesTest.php @@ -85,7 +85,7 @@ public function testGeocodeWithRealPlace() $this->markTestSkipped('You need to configure the GEONAMES_USERNAME value in phpunit.xml'); } - $provider = new Geonames($this->getAdapter(), $_SERVER['GEONAMES_USERNAME']); + $provider = new Geonames($this->getAdapter($_SERVER['GEONAMES_USERNAME']), $_SERVER['GEONAMES_USERNAME']); $results = $provider->geocode('London'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -189,7 +189,7 @@ public function testGeocodeWithRealPlaceWithLocale() $this->markTestSkipped('You need to configure the GEONAMES_USERNAME value in phpunit.xml'); } - $provider = new Geonames($this->getAdapter(), $_SERVER['GEONAMES_USERNAME'], 'it_IT'); + $provider = new Geonames($this->getAdapter($_SERVER['GEONAMES_USERNAME']), $_SERVER['GEONAMES_USERNAME'], 'it_IT'); $results = $provider->geocode('London'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -293,7 +293,7 @@ public function testReverseWithRealCoordinates() $this->markTestSkipped('You need to configure the GEONAMES_USERNAME value in phpunit.xml'); } - $provider = new Geonames($this->getAdapter(), $_SERVER['GEONAMES_USERNAME']); + $provider = new Geonames($this->getAdapter($_SERVER['GEONAMES_USERNAME']), $_SERVER['GEONAMES_USERNAME']); $results = $provider->reverse(51.50853, -0.12574); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -319,7 +319,7 @@ public function testReverseWithRealCoordinatesWithLocale() $this->markTestSkipped('You need to configure the GEONAMES_USERNAME value in phpunit.xml'); } - $provider = new Geonames($this->getAdapter(), $_SERVER['GEONAMES_USERNAME'], 'it_IT'); + $provider = new Geonames($this->getAdapter($_SERVER['GEONAMES_USERNAME']), $_SERVER['GEONAMES_USERNAME'], 'it_IT'); $results = $provider->reverse(51.50853, -0.12574); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); diff --git a/tests/Geocoder/Tests/Provider/GoogleMapsTest.php b/tests/Geocoder/Tests/Provider/GoogleMapsTest.php index ce33c8b3a..be2a2a15d 100644 --- a/tests/Geocoder/Tests/Provider/GoogleMapsTest.php +++ b/tests/Geocoder/Tests/Provider/GoogleMapsTest.php @@ -315,7 +315,7 @@ public function testGeocodeWithRealValidApiKey() $this->markTestSkipped('You need to configure the GOOGLE_GEOCODING_KEY value in phpunit.xml'); } - $provider = new GoogleMaps($this->getAdapter(), null, null, true, $_SERVER['GOOGLE_GEOCODING_KEY']); + $provider = new GoogleMaps($this->getAdapter($_SERVER['GOOGLE_GEOCODING_KEY']), null, null, true, $_SERVER['GOOGLE_GEOCODING_KEY']); $results = $provider->geocode('Columbia University'); diff --git a/tests/Geocoder/Tests/Provider/IpInfoDbTest.php b/tests/Geocoder/Tests/Provider/IpInfoDbTest.php index 3aa58c38f..80897f3fc 100644 --- a/tests/Geocoder/Tests/Provider/IpInfoDbTest.php +++ b/tests/Geocoder/Tests/Provider/IpInfoDbTest.php @@ -128,7 +128,7 @@ public function testGeocodeWithRealIPv4() $this->markTestSkipped('You need to configure the IPINFODB_API_KEY value in phpunit.xml'); } - $provider = new IpInfoDb($this->getAdapter(), $_SERVER['IPINFODB_API_KEY']); + $provider = new IpInfoDb($this->getAdapter($_SERVER['IPINFODB_API_KEY']), $_SERVER['IPINFODB_API_KEY']); $results = $provider->geocode('74.125.45.100'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -158,7 +158,7 @@ public function testGeocodeWithRealIPv6() $this->markTestSkipped('You need to configure the IPINFODB_API_KEY value in phpunit.xml'); } - $provider = new IpInfoDb($this->getAdapter(), $_SERVER['IPINFODB_API_KEY']); + $provider = new IpInfoDb($this->getAdapter($_SERVER['IPINFODB_API_KEY']), $_SERVER['IPINFODB_API_KEY']); $provider->geocode('::ffff:74.125.45.100'); } @@ -171,7 +171,7 @@ public function testGetGeocodedDataWithCountryPrecision() $this->markTestSkipped('You need to configure the IPINFODB_API_KEY value in phpunit.xml'); } - $provider = new IpInfoDb($this->getAdapter(), $_SERVER['IPINFODB_API_KEY'], 'country'); + $provider = new IpInfoDb($this->getAdapter($_SERVER['IPINFODB_API_KEY']), $_SERVER['IPINFODB_API_KEY'], 'country'); $results = $provider->geocode('74.125.45.100'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); diff --git a/tests/Geocoder/Tests/Provider/MapQuestTest.php b/tests/Geocoder/Tests/Provider/MapQuestTest.php index 355440e04..9b9e81228 100644 --- a/tests/Geocoder/Tests/Provider/MapQuestTest.php +++ b/tests/Geocoder/Tests/Provider/MapQuestTest.php @@ -54,7 +54,7 @@ public function testGeocodeWithRealAddress() $this->markTestSkipped('You need to configure the MAPQUEST_API_KEY value in phpunit.xml'); } - $provider = new MapQuest($this->getAdapter(), $_SERVER['MAPQUEST_API_KEY']); + $provider = new MapQuest($this->getAdapter($_SERVER['MAPQUEST_API_KEY']), $_SERVER['MAPQUEST_API_KEY']); $results = $provider->geocode('10 avenue Gambetta, Paris, France'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -99,7 +99,7 @@ public function testReverseWithRealCoordinates() $this->markTestSkipped('You need to configure the MAPQUEST_API_KEY value in phpunit.xml'); } - $provider = new MapQuest($this->getAdapter(), $_SERVER['MAPQUEST_API_KEY']); + $provider = new MapQuest($this->getAdapter($_SERVER['MAPQUEST_API_KEY']), $_SERVER['MAPQUEST_API_KEY']); $results = $provider->reverse(54.0484068, -2.7990345); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -131,7 +131,7 @@ public function testGeocodeWithCity() $this->markTestSkipped('You need to configure the MAPQUEST_API_KEY value in phpunit.xml'); } - $provider = new MapQuest($this->getAdapter(), $_SERVER['MAPQUEST_API_KEY']); + $provider = new MapQuest($this->getAdapter($_SERVER['MAPQUEST_API_KEY']), $_SERVER['MAPQUEST_API_KEY']); $results = $provider->geocode('Hanover'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -188,7 +188,7 @@ public function testGeocodeWithCityDistrict() $this->markTestSkipped('You need to configure the MAPQUEST_API_KEY value in phpunit.xml'); } - $provider = new MapQuest($this->getAdapter(), $_SERVER['MAPQUEST_API_KEY']); + $provider = new MapQuest($this->getAdapter($_SERVER['MAPQUEST_API_KEY']), $_SERVER['MAPQUEST_API_KEY']); $results = $provider->geocode('Kalbacher Hauptstraße 10, 60437 Frankfurt, Germany'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); diff --git a/tests/Geocoder/Tests/Provider/MaxMindTest.php b/tests/Geocoder/Tests/Provider/MaxMindTest.php index 876f09a9d..cbe313465 100644 --- a/tests/Geocoder/Tests/Provider/MaxMindTest.php +++ b/tests/Geocoder/Tests/Provider/MaxMindTest.php @@ -294,7 +294,7 @@ public function testGeocodeServiceWithRealIPv4() $this->markTestSkipped('You need to configure the MAXMIND_API_KEY value in phpunit.xml'); } - $provider = new MaxMind($this->getAdapter(), $_SERVER['MAXMIND_API_KEY']); + $provider = new MaxMind($this->getAdapter($_SERVER['MAXMIND_API_KEY']), $_SERVER['MAXMIND_API_KEY']); $results = $provider->geocode('74.200.247.159'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -325,7 +325,7 @@ public function testGeocodeOmniServiceWithRealIPv4() $this->markTestSkipped('You need to configure the MAXMIND_API_KEY value in phpunit.xml'); } - $provider = new MaxMind($this->getAdapter(), $_SERVER['MAXMIND_API_KEY'], + $provider = new MaxMind($this->getAdapter($_SERVER['MAXMIND_API_KEY']), $_SERVER['MAXMIND_API_KEY'], MaxMind::OMNI_SERVICE); $results = $provider->geocode('74.200.247.159'); @@ -357,7 +357,7 @@ public function testGeocodeOmniServiceWithRealIPv4WithSslAndEncoding() $this->markTestSkipped('You need to configure the MAXMIND_API_KEY value in phpunit.xml'); } - $provider = new MaxMind($this->getAdapter(), $_SERVER['MAXMIND_API_KEY'], + $provider = new MaxMind($this->getAdapter($_SERVER['MAXMIND_API_KEY']), $_SERVER['MAXMIND_API_KEY'], MaxMind::OMNI_SERVICE, true); $results = $provider->geocode('189.26.128.80'); @@ -389,7 +389,7 @@ public function testGeocodeWithRealIPv6() $this->markTestSkipped('You need to configure the MAXMIND_API_KEY value in phpunit.xml'); } - $provider = new MaxMind($this->getAdapter(), $_SERVER['MAXMIND_API_KEY']); + $provider = new MaxMind($this->getAdapter($_SERVER['MAXMIND_API_KEY']), $_SERVER['MAXMIND_API_KEY']); $results = $provider->geocode('2002:4293:f4d6:0:0:0:0:0'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -420,7 +420,7 @@ public function testGeocodeOmniServiceWithRealIPv6WithSsl() $this->markTestSkipped('You need to configure the MAXMIND_API_KEY value in phpunit.xml'); } - $provider = new MaxMind($this->getAdapter(), $_SERVER['MAXMIND_API_KEY'], + $provider = new MaxMind($this->getAdapter($_SERVER['MAXMIND_API_KEY']), $_SERVER['MAXMIND_API_KEY'], MaxMind::OMNI_SERVICE, true); $results = $provider->geocode('2002:4293:f4d6:0:0:0:0:0'); diff --git a/tests/Geocoder/Tests/Provider/OpenCageTest.php b/tests/Geocoder/Tests/Provider/OpenCageTest.php index 050bd72f6..113ef9e2f 100644 --- a/tests/Geocoder/Tests/Provider/OpenCageTest.php +++ b/tests/Geocoder/Tests/Provider/OpenCageTest.php @@ -52,7 +52,7 @@ public function testGeocodeWithRealAddress() $this->markTestSkipped('You need to configure the OPENCAGE_API_KEY value in phpunit.xml'); } - $provider = new OpenCage($this->getAdapter(), $_SERVER['OPENCAGE_API_KEY']); + $provider = new OpenCage($this->getAdapter($_SERVER['OPENCAGE_API_KEY']), $_SERVER['OPENCAGE_API_KEY']); $results = $provider->geocode('10 avenue Gambetta, Paris, France'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -99,7 +99,7 @@ public function testReverseWithRealCoordinates() $this->markTestSkipped('You need to configure the OPENCAGE_API_KEY value in phpunit.xml'); } - $provider = new OpenCage($this->getAdapter(), $_SERVER['OPENCAGE_API_KEY']); + $provider = new OpenCage($this->getAdapter($_SERVER['OPENCAGE_API_KEY']), $_SERVER['OPENCAGE_API_KEY']); $results = $provider->reverse(54.0484068, -2.7990345); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -133,7 +133,7 @@ public function testGeocodeWithCity() $this->markTestSkipped('You need to configure the OPENCAGE_API_KEY value in phpunit.xml'); } - $provider = new OpenCage($this->getAdapter(), $_SERVER['OPENCAGE_API_KEY']); + $provider = new OpenCage($this->getAdapter($_SERVER['OPENCAGE_API_KEY']), $_SERVER['OPENCAGE_API_KEY']); $results = $provider->geocode('Hanover'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -188,7 +188,7 @@ public function testGeocodeWithCityDistrict() $this->markTestSkipped('You need to configure the OPENCAGE_API_KEY value in phpunit.xml'); } - $provider = new OpenCage($this->getAdapter(), $_SERVER['OPENCAGE_API_KEY']); + $provider = new OpenCage($this->getAdapter($_SERVER['OPENCAGE_API_KEY']), $_SERVER['OPENCAGE_API_KEY']); $results = $provider->geocode('Kalbacher Hauptstraße 10, 60437 Frankfurt, Germany'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -218,7 +218,7 @@ public function testGeocodeWithLocale() $this->markTestSkipped('You need to configure the OPENCAGE_API_KEY value in phpunit.xml'); } - $provider = new OpenCage($this->getAdapter(), $_SERVER['OPENCAGE_API_KEY'], true, 'es'); + $provider = new OpenCage($this->getAdapter($_SERVER['OPENCAGE_API_KEY']), $_SERVER['OPENCAGE_API_KEY'], true, 'es'); $results = $provider->geocode('London'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); diff --git a/tests/Geocoder/Tests/Provider/OpenStreetMapTest.php b/tests/Geocoder/Tests/Provider/OpenStreetMapTest.php index 4f98e1af9..1c28b5389 100644 --- a/tests/Geocoder/Tests/Provider/OpenStreetMapTest.php +++ b/tests/Geocoder/Tests/Provider/OpenStreetMapTest.php @@ -33,14 +33,14 @@ public function testGeocodeWithRealAddress() $this->assertEquals(2.46976041793823, $result->getBounds()->getEast(), '', 0.01); $this->assertNull($result->getStreetNumber()); $this->assertNull($result->getStreetName()); - $this->assertEquals(75000, $result->getPostalCode()); + $this->assertNull($result->getPostalCode()); $this->assertNull($result->getSubLocality()); $this->assertEquals('Paris', $result->getLocality()); $this->assertCount(2, $result->getAdminLevels()); $this->assertEquals('Paris', $result->getAdminLevels()->get(2)->getName()); $this->assertEquals('Île-de-France', $result->getAdminLevels()->get(1)->getName()); $this->assertNull($result->getAdminLevels()->get(1)->getCode()); - $this->assertEquals('France métropolitaine', $result->getCountry()->getName()); + $this->assertEquals('France', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); /** @var \Geocoder\Model\Address $result */ @@ -62,7 +62,7 @@ public function testGeocodeWithRealAddress() $this->assertEquals('Paris', $result->getAdminLevels()->get(2)->getName()); $this->assertEquals('Île-de-France', $result->getAdminLevels()->get(1)->getName()); $this->assertNull($result->getAdminLevels()->get(1)->getCode()); - $this->assertEquals('France métropolitaine', $result->getCountry()->getName()); + $this->assertEquals('France', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); /** @var \Geocoder\Model\Address $result */ @@ -152,7 +152,7 @@ public function testGeocodeWithRealAddressWithLocale() $this->assertEquals(3.13707232475281, $result->getBounds()->getEast(), '', 0.01); $this->assertNull($result->getStreetNumber()); $this->assertEquals('Allée Évariste Galois', $result->getStreetName()); - $this->assertEquals('63170', $result->getPostalCode()); + $this->assertEquals('63000', $result->getPostalCode()); $this->assertEquals('La Pardieu', $result->getSubLocality()); $this->assertEquals('Clermont-Ferrand', $result->getLocality()); $this->assertCount(2, $result->getAdminLevels()); @@ -176,7 +176,7 @@ public function testGeocodeWithRealAddressWithLocale() $this->assertEquals('Allée Évariste Galois', $result->getStreetName()); $this->assertEquals('63170', $result->getPostalCode()); $this->assertEquals('Cap Sud', $result->getSubLocality()); - $this->assertEquals('Aubière', $result->getLocality()); + $this->assertNull($result->getLocality()); $this->assertCount(2, $result->getAdminLevels()); $this->assertEquals('Clermont-Ferrand', $result->getAdminLevels()->get(2)->getName()); $this->assertEquals('Auvergne', $result->getAdminLevels()->get(1)->getName()); @@ -205,7 +205,8 @@ public function testReverseWithRealCoordinates() $this->assertEquals('VII', $result->getSubLocality()); $this->assertEquals('Turku', $result->getLocality()); $this->assertCount(2, $result->getAdminLevels()); - $this->assertEquals('Lounais-Suomen aluehallintovirasto', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('Varsinais-Suomi', $result->getAdminLevels()->get(2)->getName()); + $this->assertEquals('Etelä-Suomi', $result->getAdminLevels()->get(1)->getName()); $this->assertNull( $result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('Suomi', $result->getCountry()->getName()); $this->assertEquals('FI', $result->getCountry()->getCode()); @@ -244,8 +245,7 @@ public function testReverseWithRealCoordinatesWithLocale() $this->assertEquals(60437, $result->getPostalCode()); $this->assertEquals('Kalbach', $result->getSubLocality()); $this->assertEquals('Frankfurt am Main', $result->getLocality()); - $this->assertCount(2, $result->getAdminLevels()); - $this->assertEquals('Frankfurt am Main', $result->getAdminLevels()->get(2)->getName()); + $this->assertCount(1, $result->getAdminLevels()); $this->assertEquals('Hessen', $result->getAdminLevels()->get(1)->getName()); $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('Deutschland', $result->getCountry()->getName()); @@ -264,10 +264,9 @@ public function testReverseWithRealCoordinatesWithLocale() $this->assertNull($result->getStreetNumber()); $this->assertEquals('Kalbacher Hauptstraße', $result->getStreetName()); $this->assertEquals(60437, $result->getPostalCode()); - $this->assertEquals('Bonames', $result->getSubLocality()); + $this->assertEquals('Kalbach', $result->getSubLocality()); $this->assertEquals('Frankfurt am Main', $result->getLocality()); - $this->assertCount(2, $result->getAdminLevels()); - $this->assertEquals('Frankfurt am Main', $result->getAdminLevels()->get(2)->getName()); + $this->assertCount(1, $result->getAdminLevels()); $this->assertEquals('Hessen', $result->getAdminLevels()->get(1)->getName()); $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('Deutschland', $result->getCountry()->getName()); @@ -288,8 +287,7 @@ public function testReverseWithRealCoordinatesWithLocale() $this->assertEquals(60437, $result->getPostalCode()); $this->assertEquals('Kalbach', $result->getSubLocality()); $this->assertEquals('Frankfurt am Main', $result->getLocality()); - $this->assertCount(2, $result->getAdminLevels()); - $this->assertEquals('Frankfurt am Main', $result->getAdminLevels()->get(2)->getName()); + $this->assertCount(1, $result->getAdminLevels()); $this->assertEquals('Hessen', $result->getAdminLevels()->get(1)->getName()); $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('Deutschland', $result->getCountry()->getName()); @@ -308,10 +306,9 @@ public function testReverseWithRealCoordinatesWithLocale() $this->assertNull($result->getStreetNumber()); $this->assertEquals('Kalbacher Hauptstraße', $result->getStreetName()); $this->assertEquals(60437, $result->getPostalCode()); - $this->assertEquals('Kalbach', $result->getSubLocality()); + $this->assertNull($result->getSubLocality()); $this->assertEquals('Frankfurt am Main', $result->getLocality()); - $this->assertCount(2, $result->getAdminLevels()); - $this->assertEquals('Frankfurt am Main', $result->getAdminLevels()->get(2)->getName()); + $this->assertCount(1, $result->getAdminLevels()); $this->assertEquals('Hessen', $result->getAdminLevels()->get(1)->getName()); $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('Deutschland', $result->getCountry()->getName()); diff --git a/tests/Geocoder/Tests/Provider/TomTomTest.php b/tests/Geocoder/Tests/Provider/TomTomTest.php index f2ed76d55..2c67feeaf 100644 --- a/tests/Geocoder/Tests/Provider/TomTomTest.php +++ b/tests/Geocoder/Tests/Provider/TomTomTest.php @@ -84,7 +84,7 @@ public function testGeocodeWithRealAddress() $this->markTestSkipped('You need to configure the TOMTOM_MAP_KEY value in phpunit.xml'); } - $provider = new TomTom($this->getAdapter(), $_SERVER['TOMTOM_MAP_KEY']); + $provider = new TomTom($this->getAdapter($_SERVER['TOMTOM_MAP_KEY']), $_SERVER['TOMTOM_MAP_KEY']); $results = $provider->geocode('Tagensvej 47, 2200 København N'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -113,7 +113,7 @@ public function testGeocodeWithRealAddressWithFrenchLocale() $this->markTestSkipped('You need to configure the TOMTOM_MAP_KEY value in phpunit.xml'); } - $provider = new TomTom($this->getAdapter(), $_SERVER['TOMTOM_MAP_KEY'], 'fr_FR'); + $provider = new TomTom($this->getAdapter($_SERVER['TOMTOM_MAP_KEY']), $_SERVER['TOMTOM_MAP_KEY'], 'fr_FR'); $results = $provider->geocode('Tagensvej 47, 2200 København N'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -142,7 +142,7 @@ public function testGeocodeWithRealAddressWithSwedishLocale() $this->markTestSkipped('You need to configure the TOMTOM_MAP_KEY value in phpunit.xml'); } - $provider = new TomTom($this->getAdapter(), $_SERVER['TOMTOM_MAP_KEY'], 'sv-SE'); + $provider = new TomTom($this->getAdapter($_SERVER['TOMTOM_MAP_KEY']), $_SERVER['TOMTOM_MAP_KEY'], 'sv-SE'); $results = $provider->geocode('Tagensvej 47, 2200 København N'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -171,7 +171,7 @@ public function testGeocodeWithRealAddressReturnsMultipleResults() $this->markTestSkipped('You need to configure the TOMTOM_MAP_KEY value in phpunit.xml'); } - $provider = new TomTom($this->getAdapter(), $_SERVER['TOMTOM_MAP_KEY']); + $provider = new TomTom($this->getAdapter($_SERVER['TOMTOM_MAP_KEY']), $_SERVER['TOMTOM_MAP_KEY']); $results = $provider->geocode('Paris'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -354,7 +354,7 @@ public function testReverseWithRealCoordinates() $this->markTestSkipped('You need to configure the TOMTOM_MAP_KEY value in phpunit.xml'); } - $provider = new TomTom($this->getAdapter(), $_SERVER['TOMTOM_MAP_KEY']); + $provider = new TomTom($this->getAdapter($_SERVER['TOMTOM_MAP_KEY']), $_SERVER['TOMTOM_MAP_KEY']); $results = $provider->reverse(48.86321648955345, 2.3887719959020615); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); @@ -383,7 +383,7 @@ public function testGeocodeWithRealCoordinates() $this->markTestSkipped('You need to configure the TOMTOM_MAP_KEY value in phpunit.xml'); } - $provider = new TomTom($this->getAdapter(), $_SERVER['TOMTOM_MAP_KEY']); + $provider = new TomTom($this->getAdapter($_SERVER['TOMTOM_MAP_KEY']), $_SERVER['TOMTOM_MAP_KEY']); $results = $provider->reverse(56.5231, 10.0659); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); diff --git a/tests/Geocoder/Tests/Provider/YandexTest.php b/tests/Geocoder/Tests/Provider/YandexTest.php index cb7c83c18..ae6cdc164 100644 --- a/tests/Geocoder/Tests/Provider/YandexTest.php +++ b/tests/Geocoder/Tests/Provider/YandexTest.php @@ -92,7 +92,7 @@ public function testGeocodeWithRealAddress() $results = $provider->geocode('10 avenue Gambetta, Paris, France'); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); - $this->assertCount(5, $results); + $this->assertCount(1, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); @@ -106,6 +106,8 @@ public function testGeocodeWithRealAddress() $this->assertEquals(2.391064, $result->getBounds()->getEast(), '', 0.01); $this->assertEquals(10, $result->getStreetNumber()); $this->assertEquals('Avenue Gambetta', $result->getStreetName()); + $this->assertEquals('Париж', $result->getLocality()); + $this->assertEquals('XX округ', $result->getSubLocality()); $this->assertCount(1, $result->getAdminLevels()); $this->assertEquals('Иль-Де-Франс', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Франция', $result->getCountry()->getName()); @@ -113,34 +115,8 @@ public function testGeocodeWithRealAddress() // not provided $this->assertNull($result->getPostalCode()); - $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getLocality()); $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getTimezone()); - - /** @var \Geocoder\Model\Address $result */ - $result = $results->get(1); - $this->assertInstanceOf('Geocoder\Model\Address', $result); - $this->assertEquals(48.810138, $result->getLatitude(), '', 0.01); - $this->assertEquals(2.435926, $result->getLongitude(), '', 0.01); - - /** @var \Geocoder\Model\Address $result */ - $result = $results->get(2); - $this->assertInstanceOf('Geocoder\Model\Address', $result); - $this->assertEquals(48.892773, $result->getLatitude(), '', 0.01); - $this->assertEquals(2.246174, $result->getLongitude(), '', 0.01); - - /** @var \Geocoder\Model\Address $result */ - $result = $results->get(3); - $this->assertInstanceOf('Geocoder\Model\Address', $result); - $this->assertEquals(48.844640, $result->getLatitude(), '', 0.01); - $this->assertEquals(2.420493, $result->getLongitude(), '', 0.01); - - /** @var \Geocoder\Model\Address $result */ - $result = $results->get(4); - $this->assertInstanceOf('Geocoder\Model\Address', $result); - $this->assertEquals(48.813520, $result->getLatitude(), '', 0.01); - $this->assertEquals(2.324642, $result->getLongitude(), '', 0.01); } public function testGeocodeWithRealAddressWithUALocale() @@ -154,8 +130,8 @@ public function testGeocodeWithRealAddressWithUALocale() /** @var \Geocoder\Model\Address $result */ $result = $results->first(); $this->assertInstanceOf('Geocoder\Model\Address', $result); - $this->assertEquals(55.675682, $result->getLatitude(), '', 0.01); - $this->assertEquals(12.567602, $result->getLongitude(), '', 0.01); + $this->assertEquals(55.675676, $result->getLatitude(), '', 0.01); + $this->assertEquals(12.567593, $result->getLongitude(), '', 0.01); $this->assertTrue($result->getBounds()->isDefined()); $this->assertEquals(55.614999, $result->getBounds()->getSouth(), '', 0.01); $this->assertEquals(12.45295, $result->getBounds()->getWest(), '', 0.01); @@ -178,8 +154,8 @@ public function testGeocodeWithRealAddressWithUALocale() /** @var \Geocoder\Model\Address $result */ $result = $results->get(1); $this->assertInstanceOf('Geocoder\Model\Address', $result); - $this->assertEquals(55.614439, $result->getLatitude(), '', 0.01); - $this->assertEquals(12.645351, $result->getLongitude(), '', 0.01); + $this->assertEquals(55.455739, $result->getLatitude(), '', 0.01); + $this->assertEquals(9.972854, $result->getLongitude(), '', 0.01); /** @var \Geocoder\Model\Address $result */ $result = $results->get(2); @@ -211,14 +187,14 @@ public function testGeocodeWithRealAddressWithUSLocale() /** @var \Geocoder\Model\Address $result */ $result = $results->first(); $this->assertInstanceOf('Geocoder\Model\Address', $result); - $this->assertEquals(38.898720, $result->getLatitude(), '', 0.01); - $this->assertEquals(-77.036384, $result->getLongitude(), '', 0.01); + $this->assertEquals(38.897695, $result->getLatitude(), '', 0.01); + $this->assertEquals(-77.038692, $result->getLongitude(), '', 0.01); $this->assertTrue($result->getBounds()->isDefined()); - $this->assertEquals(38.897119, $result->getBounds()->getSouth(), '', 0.01); - $this->assertEquals(-77.058078, $result->getBounds()->getWest(), '', 0.01); - $this->assertEquals(38.90032, $result->getBounds()->getNorth(), '', 0.01); - $this->assertEquals(-77.012453, $result->getBounds()->getEast(), '', 0.01); - $this->assertNull($result->getStreetNumber()); + $this->assertEquals(38.891265, $result->getBounds()->getSouth(), '', 0.01); + $this->assertEquals(-77.046921, $result->getBounds()->getWest(), '', 0.01); + $this->assertEquals(38.904125, $result->getBounds()->getNorth(), '', 0.01); + $this->assertEquals(-77.030464, $result->getBounds()->getEast(), '', 0.01); + $this->assertEquals(1600, $result->getStreetNumber()); $this->assertEquals('Pennsylvania Ave NW', $result->getStreetName()); $this->assertEquals('Washington', $result->getLocality()); $this->assertCount(1, $result->getAdminLevels()); @@ -254,13 +230,14 @@ public function testGeocodeWithRealAddressWithBYLocale() $this->assertEquals(19, $result->getStreetNumber()); $this->assertEquals('улица Ленина', $result->getStreetName()); $this->assertEquals('Минск', $result->getLocality()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('Минск', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Беларусь', $result->getCountry()->getName()); $this->assertEquals('BY', $result->getCountry()->getCode()); // not provided $this->assertNull($result->getPostalCode()); $this->assertNull($result->getSubLocality()); - $this->assertEmpty($result->getAdminLevels()); $this->assertNull($result->getTimezone()); } @@ -300,7 +277,7 @@ public function testReverseWithRealCoordinates() $results = $provider->reverse(48.863216489553, 2.388771995902061); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); - $this->assertCount(3, $results); + $this->assertCount(5, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); @@ -311,9 +288,11 @@ public function testReverseWithRealCoordinates() $this->assertEquals(48.86294, $result->getBounds()->getSouth(), '', 0.01); $this->assertEquals(2.387497, $result->getBounds()->getWest(), '', 0.01); $this->assertEquals(48.877038, $result->getBounds()->getNorth(), '', 0.01); - $this->assertEquals(2.423214, $result->getBounds()->getEast(), '', 0.01); + $this->assertEquals(2.406587, $result->getBounds()->getEast(), '', 0.01); $this->assertNull($result->getStreetNumber()); $this->assertEquals('Avenue Gambetta', $result->getStreetName()); + $this->assertEquals('Париж', $result->getLocality()); + $this->assertEquals('XX округ', $result->getSubLocality()); $this->assertCount(1, $result->getAdminLevels()); $this->assertEquals('Иль-Де-Франс', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Франция', $result->getCountry()->getName()); @@ -321,22 +300,20 @@ public function testReverseWithRealCoordinates() // not provided $this->assertNull($result->getPostalCode()); - $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getLocality()); $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getTimezone()); /** @var \Geocoder\Model\Address $result */ $result = $results->get(1); $this->assertInstanceOf('Geocoder\Model\Address', $result); - $this->assertEquals(48.709273, $result->getLatitude(), '', 0.01); - $this->assertEquals(2.503371, $result->getLongitude(), '', 0.01); + $this->assertEquals(48.864848, $result->getLatitude(), '', 0.01); + $this->assertEquals(2.3993549, $result->getLongitude(), '', 0.01); /** @var \Geocoder\Model\Address $result */ $result = $results->get(2); $this->assertInstanceOf('Geocoder\Model\Address', $result); - $this->assertEquals(46.621810, $result->getLatitude(), '', 0.01); - $this->assertEquals(2.452113, $result->getLongitude(), '', 0.01); + $this->assertEquals(48.856929, $result->getLatitude(), '', 0.01); + $this->assertEquals(2.341197, $result->getLongitude(), '', 0.01); } public function testReverseWithRealCoordinatesWithUSLocaleAndStreeToponym() @@ -356,9 +333,11 @@ public function testReverseWithRealCoordinatesWithUSLocaleAndStreeToponym() $this->assertEquals(48.86294, $result->getBounds()->getSouth(), '', 0.01); $this->assertEquals(2.387497, $result->getBounds()->getWest(), '', 0.01); $this->assertEquals(48.877038, $result->getBounds()->getNorth(), '', 0.01); - $this->assertEquals(2.423214, $result->getBounds()->getEast(), '', 0.01); + $this->assertEquals(2.406587, $result->getBounds()->getEast(), '', 0.01); $this->assertNull($result->getStreetNumber()); $this->assertEquals('Avenue Gambetta', $result->getStreetName()); + $this->assertEquals('20e Arrondissement', $result->getSubLocality()); + $this->assertEquals('Paris', $result->getLocality()); $this->assertCount(1, $result->getAdminLevels()); $this->assertEquals('Ile-de-France', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('France', $result->getCountry()->getName()); @@ -366,8 +345,6 @@ public function testReverseWithRealCoordinatesWithUSLocaleAndStreeToponym() // not provided $this->assertNull($result->getPostalCode()); - $this->assertNull($result->getSubLocality()); - $this->assertNull($result->getLocality()); $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getTimezone()); @@ -415,16 +392,16 @@ public function testReverseWithRealCoordinatesWithUALocaleAndHouseToponym() $this->assertEquals(60.455474, $result->getBounds()->getNorth(), '', 0.01); $this->assertEquals(22.258609, $result->getBounds()->getEast(), '', 0.01); $this->assertEquals(36, $result->getStreetNumber()); - $this->assertEquals('Ratapihankatu', $result->getStreetName()); + $this->assertEquals('Bangårdsgatan', $result->getStreetName()); $this->assertEquals('Турку', $result->getLocality()); + $this->assertEquals('Кескуста', $result->getSubLocality()); $this->assertCount(1, $result->getAdminLevels()); - $this->assertEquals('Исконная Финляндия', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('Юго-Западная Финляндия', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Фінляндія', $result->getCountry()->getName()); $this->assertEquals('FI', $result->getCountry()->getCode()); // not provided $this->assertNull($result->getPostalCode()); - $this->assertNull($result->getSubLocality()); $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getTimezone()); } @@ -440,16 +417,16 @@ public function testReverseWithRealCoordinatesWithTRLocaleAndLocalityToponym() /** @var \Geocoder\Model\Address $result */ $result = $results->first(); $this->assertInstanceOf('Geocoder\Model\Address', $result); - $this->assertEquals(40.909452, $result->getLatitude(), '', 0.01); - $this->assertEquals(29.138608, $result->getLongitude(), '', 0.01); + $this->assertEquals(40.874651, $result->getLatitude(), '', 0.01); + $this->assertEquals(29.129562, $result->getLongitude(), '', 0.01); $this->assertTrue($result->getBounds()->isDefined()); $this->assertEquals(40.860413, $result->getBounds()->getSouth(), '', 0.01); - $this->assertEquals(29.072708, $result->getBounds()->getWest(), '', 0.01); - $this->assertEquals(40.960403, $result->getBounds()->getNorth(), '', 0.01); - $this->assertEquals(29.204508, $result->getBounds()->getEast(), '', 0.01); + $this->assertEquals(29.107230, $result->getBounds()->getWest(), '', 0.01); + $this->assertEquals(40.876111, $result->getBounds()->getNorth(), '', 0.01); + $this->assertEquals(29.139021, $result->getBounds()->getEast(), '', 0.01); $this->assertNull($result->getStreetName()); $this->assertNull($result->getStreetNumber()); - $this->assertEquals('Dragos', $result->getLocality()); + $this->assertEquals('Adalar', $result->getLocality()); $this->assertCount(1, $result->getAdminLevels()); $this->assertEquals('İstanbul', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Türkiye', $result->getCountry()->getName()); diff --git a/tests/Geocoder/Tests/TestCase.php b/tests/Geocoder/Tests/TestCase.php index f4f6ecf78..c5be49ac5 100644 --- a/tests/Geocoder/Tests/TestCase.php +++ b/tests/Geocoder/Tests/TestCase.php @@ -71,9 +71,9 @@ protected function getMockAdapterReturns($returnValue) * * @return HttpAdapterInterface */ - protected function getAdapter() + protected function getAdapter($apiKey = null) { - return new CachedResponseAdapter(new CurlHttpAdapter(), $this->useCache()); + return new CachedResponseAdapter(new CurlHttpAdapter(), $this->useCache(), $apiKey); } /** From 990ab98c3e12ae2da20a568e5787b2af2b357fc3 Mon Sep 17 00:00:00 2001 From: Giorgio Premi Date: Sun, 1 Feb 2015 18:07:03 +0100 Subject: [PATCH 16/17] Yandex Provider support 2 admin levels (+minor fixes) --- src/Geocoder/Provider/Yandex.php | 19 ++++++++------- tests/Geocoder/Tests/Provider/YandexTest.php | 25 ++++++++++++++------ 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/Geocoder/Provider/Yandex.php b/src/Geocoder/Provider/Yandex.php index cb6512bb2..db50f0871 100644 --- a/src/Geocoder/Provider/Yandex.php +++ b/src/Geocoder/Provider/Yandex.php @@ -122,27 +122,28 @@ function ($value, $key) use (&$details) {$details[$key] = $value;} if (! empty($details['lowerCorner'])) { $coordinates = explode(' ', $details['lowerCorner']); - $bounds['south'] = $coordinates[1]; - $bounds['west'] = $coordinates[0]; + $bounds['south'] = (float) $coordinates[1]; + $bounds['west'] = (float) $coordinates[0]; } if (! empty($details['upperCorner'])) { $coordinates = explode(' ', $details['upperCorner']); - $bounds['north'] = $coordinates[1]; - $bounds['east'] = $coordinates[0]; + $bounds['north'] = (float) $coordinates[1]; + $bounds['east'] = (float) $coordinates[0]; } $coordinates = explode(' ', $details['pos']); $adminLevels = []; - - if (isset($details['AdministrativeAreaName'])) { - $adminLevels[] = ['name' => $details['AdministrativeAreaName'], 'level' => 1]; + foreach (['AdministrativeAreaName', 'SubAdministrativeAreaName'] as $i => $detail) { + if (isset($details[$detail])) { + $adminLevels[] = ['name' => $details[$detail], 'level' => $i + 1]; + } } $results[] = array_merge($this->getDefaults(), array( - 'latitude' => $coordinates[1], - 'longitude' => $coordinates[0], + 'latitude' => (float) $coordinates[1], + 'longitude' => (float) $coordinates[0], 'bounds' => $bounds, 'streetNumber' => isset($details['PremiseNumber']) ? $details['PremiseNumber'] : null, 'streetName' => isset($details['ThoroughfareName']) ? $details['ThoroughfareName'] : null, diff --git a/tests/Geocoder/Tests/Provider/YandexTest.php b/tests/Geocoder/Tests/Provider/YandexTest.php index ae6cdc164..a547bd345 100644 --- a/tests/Geocoder/Tests/Provider/YandexTest.php +++ b/tests/Geocoder/Tests/Provider/YandexTest.php @@ -108,13 +108,15 @@ public function testGeocodeWithRealAddress() $this->assertEquals('Avenue Gambetta', $result->getStreetName()); $this->assertEquals('Париж', $result->getLocality()); $this->assertEquals('XX округ', $result->getSubLocality()); - $this->assertCount(1, $result->getAdminLevels()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Париж', $result->getAdminLevels()->get(2)->getName()); $this->assertEquals('Иль-Де-Франс', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Франция', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); // not provided $this->assertNull($result->getPostalCode()); + $this->assertNull($result->getAdminLevels()->get(2)->getCode()); $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getTimezone()); } @@ -140,7 +142,7 @@ public function testGeocodeWithRealAddressWithUALocale() $this->assertNull($result->getStreetNumber()); $this->assertNull($result->getStreetName()); $this->assertEquals('Копенгаген', $result->getLocality()); - $this->assertCount(1, $result->getAdminLevels()); + $this->assertCount(2, $result->getAdminLevels()); $this->assertEquals('Столичная область', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Данія', $result->getCountry()->getName()); $this->assertEquals('DK', $result->getCountry()->getCode()); @@ -197,7 +199,8 @@ public function testGeocodeWithRealAddressWithUSLocale() $this->assertEquals(1600, $result->getStreetNumber()); $this->assertEquals('Pennsylvania Ave NW', $result->getStreetName()); $this->assertEquals('Washington', $result->getLocality()); - $this->assertCount(1, $result->getAdminLevels()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('District of Columbia', $result->getAdminLevels()->get(2)->getName()); $this->assertEquals('District of Columbia', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); @@ -293,13 +296,15 @@ public function testReverseWithRealCoordinates() $this->assertEquals('Avenue Gambetta', $result->getStreetName()); $this->assertEquals('Париж', $result->getLocality()); $this->assertEquals('XX округ', $result->getSubLocality()); - $this->assertCount(1, $result->getAdminLevels()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Париж', $result->getAdminLevels()->get(2)->getName()); $this->assertEquals('Иль-Де-Франс', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Франция', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); // not provided $this->assertNull($result->getPostalCode()); + $this->assertNull($result->getAdminLevels()->get(2)->getCode()); $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getTimezone()); @@ -338,13 +343,15 @@ public function testReverseWithRealCoordinatesWithUSLocaleAndStreeToponym() $this->assertEquals('Avenue Gambetta', $result->getStreetName()); $this->assertEquals('20e Arrondissement', $result->getSubLocality()); $this->assertEquals('Paris', $result->getLocality()); - $this->assertCount(1, $result->getAdminLevels()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Paris', $result->getAdminLevels()->get(2)->getName()); $this->assertEquals('Ile-de-France', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('France', $result->getCountry()->getName()); $this->assertEquals('FR', $result->getCountry()->getCode()); // not provided $this->assertNull($result->getPostalCode()); + $this->assertNull($result->getAdminLevels()->get(2)->getCode()); $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getTimezone()); @@ -395,13 +402,15 @@ public function testReverseWithRealCoordinatesWithUALocaleAndHouseToponym() $this->assertEquals('Bangårdsgatan', $result->getStreetName()); $this->assertEquals('Турку', $result->getLocality()); $this->assertEquals('Кескуста', $result->getSubLocality()); - $this->assertCount(1, $result->getAdminLevels()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Исконная Финляндия', $result->getAdminLevels()->get(2)->getName()); $this->assertEquals('Юго-Западная Финляндия', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Фінляндія', $result->getCountry()->getName()); $this->assertEquals('FI', $result->getCountry()->getCode()); // not provided $this->assertNull($result->getPostalCode()); + $this->assertNull($result->getAdminLevels()->get(2)->getCode()); $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getTimezone()); } @@ -427,7 +436,8 @@ public function testReverseWithRealCoordinatesWithTRLocaleAndLocalityToponym() $this->assertNull($result->getStreetName()); $this->assertNull($result->getStreetNumber()); $this->assertEquals('Adalar', $result->getLocality()); - $this->assertCount(1, $result->getAdminLevels()); + $this->assertCount(2, $result->getAdminLevels()); + $this->assertEquals('Adalar', $result->getAdminLevels()->get(2)->getName()); $this->assertEquals('İstanbul', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Türkiye', $result->getCountry()->getName()); $this->assertEquals('TR', $result->getCountry()->getCode()); @@ -435,6 +445,7 @@ public function testReverseWithRealCoordinatesWithTRLocaleAndLocalityToponym() // not provided $this->assertNull($result->getPostalCode()); $this->assertNull($result->getSubLocality()); + $this->assertNull($result->getAdminLevels()->get(2)->getCode()); $this->assertNull($result->getAdminLevels()->get(1)->getCode()); $this->assertNull($result->getTimezone()); } From 11ccbc45172f939f2bed976bce0583a17ff87920 Mon Sep 17 00:00:00 2001 From: Giorgio Premi Date: Fri, 13 Feb 2015 10:30:23 +0100 Subject: [PATCH 17/17] Minor syntax fixes --- src/Geocoder/Formatter/StringFormatter.php | 14 +++++++------- src/Geocoder/Provider/GeoIPs.php | 11 +++++++++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/Geocoder/Formatter/StringFormatter.php b/src/Geocoder/Formatter/StringFormatter.php index 9d547c747..1ca09d808 100644 --- a/src/Geocoder/Formatter/StringFormatter.php +++ b/src/Geocoder/Formatter/StringFormatter.php @@ -49,7 +49,7 @@ class StringFormatter */ public function format(Address $address, $format) { - $tr = [ + $replace = [ self::STREET_NUMBER => $address->getStreetNumber(), self::STREET_NAME => $address->getStreetName(), self::LOCALITY => $address->getLocality(), @@ -60,16 +60,16 @@ public function format(Address $address, $format) self::TIMEZONE => $address->getTimezone(), ]; - for ($level = 1; $level <= AdminLevelCollection::MAX_LEVEL_DEPTH; ++ $level) { - $tr[self::ADMIN_LEVEL . $level] = null; - $tr[self::ADMIN_LEVEL_CODE . $level] = null; + for ($level = 1; $level <= AdminLevelCollection::MAX_LEVEL_DEPTH; $level ++) { + $replace[self::ADMIN_LEVEL . $level] = null; + $replace[self::ADMIN_LEVEL_CODE . $level] = null; } foreach ($address->getAdminLevels() as $level => $adminLevel) { - $tr[self::ADMIN_LEVEL . $level] = $adminLevel->getName(); - $tr[self::ADMIN_LEVEL_CODE . $level] = $adminLevel->getCode(); + $replace[self::ADMIN_LEVEL . $level] = $adminLevel->getName(); + $replace[self::ADMIN_LEVEL_CODE . $level] = $adminLevel->getCode(); } - return strtr($format, $tr); + return strtr($format, $replace); } } diff --git a/src/Geocoder/Provider/GeoIPs.php b/src/Geocoder/Provider/GeoIPs.php index 2913236d3..438775555 100644 --- a/src/Geocoder/Provider/GeoIPs.php +++ b/src/Geocoder/Provider/GeoIPs.php @@ -172,11 +172,18 @@ private function executeQuery($query) $adminLevels = []; if (null !== $location['region_name'] || null !== $location['region_code']) { - $adminLevels[] = ['name' => $location['region_name'], 'code' => $location['region_code'], 'level' => 1]; + $adminLevels[] = [ + 'name' => $location['region_name'], + 'code' => $location['region_code'], + 'level' => 1 + ]; } if (null !== $location['county_name']) { - $adminLevels[] = ['name' => $location['county_name'], 'level' => 2]; + $adminLevels[] = [ + 'name' => $location['county_name'], + 'level' => 2 + ]; } $results = [];