Skip to content

Commit 4735256

Browse files
sheubjbelien
authored andcommitted
Few tests and Review on Here Provider (#871)
* Add Here Provider * Rename here.php to Here.php * Update Here.php * Update HereAddress.php * Update Here.php * Update HereAddress.php * Update Here.php * Update Here.php * Review Corrections * + * @param string $appId An App ID. + * @param string $apoCode An App code. * Add Tests files * Add phpunit.xml.dist * Corrections after running tests * use{} * FIX IT! * Few Styles #844 * HereMaps->Here * .Some more tests * style * Build Test OK if $testIpv4 = false; * Update HereTest.php * Code review from Baachi * Update Here.php * Update Readme.md * updated Here_Test and cached_responses * Add <server name="HERE_APP_ID" value="YOUR_APP_ID" /> <server name="HERE_APP_CODE" value="YOUR_APP_CODE" /> * Update Readme.md * Reworking of the Tests with adjustments to fit the two Credentials keys (appID and AppCode) of the Here Provider * style-ci correction + override testGeocodeQueryWithNoResults, testReverseQuery and testReverseQueryWithNoResults * Styles * Update IntegrationTest.php * Correct the extends and the naming (to HereCachedResponseClient) * Remove Overriding file HereCachedResponseClient.php * update cached_responses * set provider-integration-tests requirement 1.1.0 * Update Readme.md * Update Readme.md * Update composer.json
1 parent 996d117 commit 4735256

12 files changed

+20
-104
lines changed

Here.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ final class Here extends AbstractHttpProvider implements Provider
4242
/**
4343
* @var string
4444
*/
45-
private $appId = null;
45+
private $appId;
4646

4747
/**
4848
* @var string
4949
*/
50-
private $appCode = null;
50+
private $appCode;
5151

5252
/**
5353
* @param HttpClient $adapter An HTTP adapter.

Readme.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Here Geocoder provider
2-
[![Build Status](https://travis-ci.org/geocoder-php/here-provider.svg?branch=master)](http://travis-ci.org/geocoder-php/nominatim-provider)
3-
[![Latest Stable Version](https://poser.pugx.org/geocoder-php/here-provider/v/stable)](https://packagist.org/packages/geocoder-php/nominatim-provider)
4-
[![Total Downloads](https://poser.pugx.org/geocoder-php/here-provider/downloads)](https://packagist.org/packages/geocoder-php/nominatim-provider)
5-
[![Monthly Downloads](https://poser.pugx.org/geocoder-php/here-provider/d/monthly.png)](https://packagist.org/packages/geocoder-php/nominatim-provider)
6-
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/geocoder-php/here-provider.svg?style=flat-square)](https://scrutinizer-ci.com/g/geocoder-php/nominatim-provider)
7-
[![Quality Score](https://img.shields.io/scrutinizer/g/geocoder-php/here-provider.svg?style=flat-square)](https://scrutinizer-ci.com/g/geocoder-php/nominatim-provider)
2+
[![Build Status](https://travis-ci.org/geocoder-php/here-provider.svg?branch=master)](http://travis-ci.org/geocoder-php/here-provider)
3+
[![Latest Stable Version](https://poser.pugx.org/geocoder-php/here-provider/v/stable)](https://packagist.org/packages/geocoder-php/here-provider)
4+
[![Total Downloads](https://poser.pugx.org/geocoder-php/here-provider/downloads)](https://packagist.org/packages/geocoder-php/here-provider)
5+
[![Monthly Downloads](https://poser.pugx.org/geocoder-php/here-provider/d/monthly.png)](https://packagist.org/packages/geocoder-php/here-provider)
6+
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/geocoder-php/here-provider.svg?style=flat-square)](https://scrutinizer-ci.com/g/geocoder-php/here-provider)
7+
[![Quality Score](https://img.shields.io/scrutinizer/g/geocoder-php/here-provider.svg?style=flat-square)](https://scrutinizer-ci.com/g/geocoder-php/here-provider)
88
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
99

1010
This is the Here provider from the PHP Geocoder. This is a **READ ONLY** repository. See the
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
s:80:"{"Response":{"MetaInfo":{"Timestamp":"2018-06-22T09:46:26.209+0000"},"View":[]}}";
1+
s:80:"{"Response":{"MetaInfo":{"Timestamp":"2018-06-29T12:03:42.819+0000"},"View":[]}}";
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
s:991:"{"Response":{"MetaInfo":{"Timestamp":"2018-06-22T09:46:25.259+0000"},"View":[{"_type":"SearchResultsViewType","ViewId":0,"Result":[{"Relevance":1.0,"MatchLevel":"houseNumber","MatchQuality":{"Country":1.0,"City":1.0,"Street":[1.0],"HouseNumber":1.0},"MatchType":"pointAddress","Location":{"LocationId":"NT_0cb6yPlJYuup8k2I7emOLA_xAD","LocationType":"address","DisplayPosition":{"Latitude":48.8653,"Longitude":2.39844},"NavigationPosition":[{"Latitude":48.86518,"Longitude":2.39873}],"MapView":{"TopLeft":{"Latitude":48.8664242,"Longitude":2.3967311},"BottomRight":{"Latitude":48.8641758,"Longitude":2.4001489}},"Address":{"Label":"10 Avenue Gambetta, 75020 Paris, France","Country":"FRA","State":"Île-de-France","County":"Paris","City":"Paris","District":"20e Arrondissement","Street":"Avenue Gambetta","HouseNumber":"10","PostalCode":"75020","AdditionalData":[{"value":"France","key":"CountryName"},{"value":"Île-de-France","key":"StateName"},{"value":"Paris","key":"CountyName"}]}}}]}]}}";
1+
s:991:"{"Response":{"MetaInfo":{"Timestamp":"2018-06-29T12:03:41.853+0000"},"View":[{"_type":"SearchResultsViewType","ViewId":0,"Result":[{"Relevance":1.0,"MatchLevel":"houseNumber","MatchQuality":{"Country":1.0,"City":1.0,"Street":[1.0],"HouseNumber":1.0},"MatchType":"pointAddress","Location":{"LocationId":"NT_0cb6yPlJYuup8k2I7emOLA_xAD","LocationType":"address","DisplayPosition":{"Latitude":48.8653,"Longitude":2.39844},"NavigationPosition":[{"Latitude":48.86518,"Longitude":2.39873}],"MapView":{"TopLeft":{"Latitude":48.8664242,"Longitude":2.3967311},"BottomRight":{"Latitude":48.8641758,"Longitude":2.4001489}},"Address":{"Label":"10 Avenue Gambetta, 75020 Paris, France","Country":"FRA","State":"Île-de-France","County":"Paris","City":"Paris","District":"20e Arrondissement","Street":"Avenue Gambetta","HouseNumber":"10","PostalCode":"75020","AdditionalData":[{"value":"France","key":"CountryName"},{"value":"Île-de-France","key":"StateName"},{"value":"Paris","key":"CountyName"}]}}}]}]}}";
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
s:994:"{"Response":{"MetaInfo":{"Timestamp":"2018-06-20T18:12:16.673+0000"},"View":[{"_type":"SearchResultsViewType","ViewId":0,"Result":[{"Relevance":1.0,"MatchLevel":"houseNumber","MatchQuality":{"Country":1.0,"City":1.0,"Street":[1.0],"HouseNumber":1.0},"MatchType":"pointAddress","Location":{"LocationId":"NT_lWsc8knsFwVitNTFX88zmA_xAD","LocationType":"address","DisplayPosition":{"Latitude":51.50341,"Longitude":-0.12765},"NavigationPosition":[{"Latitude":51.50315,"Longitude":-0.12678}],"MapView":{"TopLeft":{"Latitude":51.5045342,"Longitude":-0.129456},"BottomRight":{"Latitude":51.5022858,"Longitude":-0.125844}},"Address":{"Label":"10 Downing Street, London, SW1A 2, United Kingdom","Country":"GBR","State":"England","County":"London","City":"London","District":"Westminster","Street":"Downing Street","HouseNumber":"10","PostalCode":"SW1A 2","AdditionalData":[{"value":"United Kingdom","key":"CountryName"},{"value":"England","key":"StateName"},{"value":"London","key":"CountyName"}]}}}]}]}}";
1+
s:994:"{"Response":{"MetaInfo":{"Timestamp":"2018-06-29T12:03:42.529+0000"},"View":[{"_type":"SearchResultsViewType","ViewId":0,"Result":[{"Relevance":1.0,"MatchLevel":"houseNumber","MatchQuality":{"Country":1.0,"City":1.0,"Street":[1.0],"HouseNumber":1.0},"MatchType":"pointAddress","Location":{"LocationId":"NT_lWsc8knsFwVitNTFX88zmA_xAD","LocationType":"address","DisplayPosition":{"Latitude":51.50341,"Longitude":-0.12765},"NavigationPosition":[{"Latitude":51.50315,"Longitude":-0.12678}],"MapView":{"TopLeft":{"Latitude":51.5045342,"Longitude":-0.129456},"BottomRight":{"Latitude":51.5022858,"Longitude":-0.125844}},"Address":{"Label":"10 Downing Street, London, SW1A 2, United Kingdom","Country":"GBR","State":"England","County":"London","City":"London","District":"Westminster","Street":"Downing Street","HouseNumber":"10","PostalCode":"SW1A 2","AdditionalData":[{"value":"United Kingdom","key":"CountryName"},{"value":"England","key":"StateName"},{"value":"London","key":"CountyName"}]}}}]}]}}";
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
s:80:"{"Response":{"MetaInfo":{"Timestamp":"2018-06-22T09:46:26.756+0000"},"View":[]}}";
1+
s:80:"{"Response":{"MetaInfo":{"Timestamp":"2018-06-29T12:06:48.849+0000"},"View":[]}}";
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
s:1267:"{"Response":{"MetaInfo":{"Timestamp":"2018-06-22T09:46:25.619+0000"},"View":[{"_type":"SearchResultsViewType","ViewId":0,"Result":[{"Relevance":1.0,"Distance":0.1,"MatchLevel":"street","MatchQuality":{"Country":1.0,"State":1.0,"County":1.0,"City":1.0,"District":1.0,"Street":[1.0],"PostalCode":1.0},"Location":{"LocationId":"NT_-nSC1VIpTK6RxGk-RZa.1D_l_1212860159_L","LocationType":"address","DisplayPosition":{"Latitude":48.8632155,"Longitude":2.3887721},"NavigationPosition":[{"Latitude":48.8632155,"Longitude":2.3887721}],"MapView":{"TopLeft":{"Latitude":48.86323,"Longitude":2.38847},"BottomRight":{"Latitude":48.86314,"Longitude":2.38883}},"Address":{"Label":"Avenue Gambetta, 75020 Paris, France","Country":"FRA","State":"Île-de-France","County":"Paris","City":"Paris","District":"20e Arrondissement","Street":"Avenue Gambetta","PostalCode":"75020","AdditionalData":[{"value":"France","key":"CountryName"},{"value":"Île-de-France","key":"StateName"},{"value":"Paris","key":"CountyName"}]},"MapReference":{"ReferenceId":"1212860159","MapId":"UWAM18112","MapVersion":"Q1/2018","MapReleaseDate":"2018-05-19","Spot":0.84,"SideOfStreet":"neither","CountryId":"20000001","StateId":"20002126","CountyId":"20002127","CityId":"20002128","DistrictId":"20002149"}}}]}]}}";
1+
s:1267:"{"Response":{"MetaInfo":{"Timestamp":"2018-06-29T12:06:47.737+0000"},"View":[{"_type":"SearchResultsViewType","ViewId":0,"Result":[{"Relevance":1.0,"Distance":0.1,"MatchLevel":"street","MatchQuality":{"Country":1.0,"State":1.0,"County":1.0,"City":1.0,"District":1.0,"Street":[1.0],"PostalCode":1.0},"Location":{"LocationId":"NT_-nSC1VIpTK6RxGk-RZa.1D_l_1212860159_L","LocationType":"address","DisplayPosition":{"Latitude":48.8632155,"Longitude":2.3887721},"NavigationPosition":[{"Latitude":48.8632155,"Longitude":2.3887721}],"MapView":{"TopLeft":{"Latitude":48.86323,"Longitude":2.38847},"BottomRight":{"Latitude":48.86314,"Longitude":2.38883}},"Address":{"Label":"Avenue Gambetta, 75020 Paris, France","Country":"FRA","State":"Île-de-France","County":"Paris","City":"Paris","District":"20e Arrondissement","Street":"Avenue Gambetta","PostalCode":"75020","AdditionalData":[{"value":"France","key":"CountryName"},{"value":"Île-de-France","key":"StateName"},{"value":"Paris","key":"CountyName"}]},"MapReference":{"ReferenceId":"1212860159","MapId":"UWAM181F0","MapVersion":"Q1/2018","MapReleaseDate":"2018-06-13","Spot":0.84,"SideOfStreet":"neither","CountryId":"20000001","StateId":"20002126","CountyId":"20002127","CityId":"20002128","DistrictId":"20002149"}}}]}]}}";
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
s:2297:"{"Response":{"MetaInfo":{"Timestamp":"2018-06-22T09:46:26.486+0000"},"View":[{"_type":"SearchResultsViewType","ViewId":0,"Result":[{"Relevance":1.0,"Distance":-0.6,"Direction":325.7,"MatchLevel":"district","MatchQuality":{"Country":1.0,"State":1.0,"County":1.0,"City":1.0,"District":1.0,"PostalCode":1.0},"Location":{"LocationId":"NT_oGdFab4eWiYVcjO-u0pTFB","LocationType":"area","DisplayPosition":{"Latitude":38.90347,"Longitude":-77.03985},"MapView":{"TopLeft":{"Latitude":38.90939,"Longitude":-77.04974},"BottomRight":{"Latitude":38.89599,"Longitude":-77.03363}},"Address":{"Label":"Connecticut Avenue/K Street, Washington, DC, United States","Country":"USA","State":"DC","County":"District of Columbia","City":"Washington","District":"Connecticut Avenue/K Street","PostalCode":"20036","AdditionalData":[{"value":"United States","key":"CountryName"},{"value":"District of Columbia","key":"StateName"},{"value":"District of Columbia","key":"CountyName"},{"value":"N","key":"PostalCodeType"}]},"MapReference":{"ReferenceId":"920905639","MapId":"NAAM18111","MapVersion":"Q1/2018","MapReleaseDate":"2018-05-24","SideOfStreet":"neither","CountryId":"21000001","StateId":"21022302","CountyId":"21022303","CityId":"21022306"}}},{"Relevance":1.0,"Distance":0.7,"Direction":163.6,"MatchLevel":"district","MatchQuality":{"Country":1.0,"State":1.0,"County":1.0,"City":1.0,"District":1.0,"PostalCode":1.0},"Location":{"LocationId":"NT_zeyJ5M16Ci53y9KE8RMTGD","LocationType":"area","DisplayPosition":{"Latitude":38.89142,"Longitude":-77.03367},"MapView":{"TopLeft":{"Latitude":38.90021,"Longitude":-77.05679},"BottomRight":{"Latitude":38.88508,"Longitude":-77.00202}},"Address":{"Label":"Washington Mall, Washington, DC, United States","Country":"USA","State":"DC","County":"District of Columbia","City":"Washington","District":"Washington Mall","PostalCode":"20004","AdditionalData":[{"value":"United States","key":"CountryName"},{"value":"District of Columbia","key":"StateName"},{"value":"District of Columbia","key":"CountyName"},{"value":"N","key":"PostalCodeType"}]},"MapReference":{"ReferenceId":"1114357553","MapId":"NAAM18111","MapVersion":"Q1/2018","MapReleaseDate":"2018-05-24","SideOfStreet":"neither","CountryId":"21000001","StateId":"21022302","CountyId":"21022303","CityId":"21022306"}}}]}]}}";
1+
s:2297:"{"Response":{"MetaInfo":{"Timestamp":"2018-06-29T12:06:48.557+0000"},"View":[{"_type":"SearchResultsViewType","ViewId":0,"Result":[{"Relevance":1.0,"Distance":-0.6,"Direction":325.7,"MatchLevel":"district","MatchQuality":{"Country":1.0,"State":1.0,"County":1.0,"City":1.0,"District":1.0,"PostalCode":1.0},"Location":{"LocationId":"NT_oGdFab4eWiYVcjO-u0pTFB","LocationType":"area","DisplayPosition":{"Latitude":38.90347,"Longitude":-77.03985},"MapView":{"TopLeft":{"Latitude":38.90939,"Longitude":-77.04974},"BottomRight":{"Latitude":38.89599,"Longitude":-77.03363}},"Address":{"Label":"Connecticut Avenue/K Street, Washington, DC, United States","Country":"USA","State":"DC","County":"District of Columbia","City":"Washington","District":"Connecticut Avenue/K Street","PostalCode":"20036","AdditionalData":[{"value":"United States","key":"CountryName"},{"value":"District of Columbia","key":"StateName"},{"value":"District of Columbia","key":"CountyName"},{"value":"N","key":"PostalCodeType"}]},"MapReference":{"ReferenceId":"920905639","MapId":"NAAM18111","MapVersion":"Q1/2018","MapReleaseDate":"2018-05-24","SideOfStreet":"neither","CountryId":"21000001","StateId":"21022302","CountyId":"21022303","CityId":"21022306"}}},{"Relevance":1.0,"Distance":0.7,"Direction":163.6,"MatchLevel":"district","MatchQuality":{"Country":1.0,"State":1.0,"County":1.0,"City":1.0,"District":1.0,"PostalCode":1.0},"Location":{"LocationId":"NT_zeyJ5M16Ci53y9KE8RMTGD","LocationType":"area","DisplayPosition":{"Latitude":38.89142,"Longitude":-77.03367},"MapView":{"TopLeft":{"Latitude":38.90021,"Longitude":-77.05679},"BottomRight":{"Latitude":38.88508,"Longitude":-77.00202}},"Address":{"Label":"Washington Mall, Washington, DC, United States","Country":"USA","State":"DC","County":"District of Columbia","City":"Washington","District":"Washington Mall","PostalCode":"20004","AdditionalData":[{"value":"United States","key":"CountryName"},{"value":"District of Columbia","key":"StateName"},{"value":"District of Columbia","key":"CountyName"},{"value":"N","key":"PostalCodeType"}]},"MapReference":{"ReferenceId":"1114357553","MapId":"NAAM18111","MapVersion":"Q1/2018","MapReleaseDate":"2018-05-24","SideOfStreet":"neither","CountryId":"21000001","StateId":"21022302","CountyId":"21022303","CityId":"21022306"}}}]}]}}";

Tests/HereCachedResponseClient.php

Lines changed: 0 additions & 84 deletions
This file was deleted.

Tests/HereTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
namespace Geocoder\Provider\Here\Tests;
1818

1919
use Geocoder\IntegrationTest\BaseTestCase;
20+
use Geocoder\IntegrationTest\CachedResponseClient;
2021
use Geocoder\Location;
2122
use Geocoder\Query\GeocodeQuery;
2223
use Geocoder\Query\ReverseQuery;
@@ -38,7 +39,7 @@ protected function getCacheDir()
3839
protected function getHttpClient($apiKey = null, $appCode = null)
3940
{
4041
if (null !== $cacheDir = $this->getCacheDir()) {
41-
return new HereCachedResponseClient(new HttplugClient(), $cacheDir, $apiKey, $appCode);
42+
return new CachedResponseClient(new HttplugClient(), $cacheDir, $apiKey, $appCode);
4243
} else {
4344
return new HttplugClient();
4445
}

0 commit comments

Comments
 (0)