Repository navigation
MapQuest Provider Now Can use an API Key For NonOpen API - #234
DevOpsChris wants to merge 5 commits into
Conversation
No tests were created, seemed too minor of a tweak.
There was a problem hiding this comment.
you should make the $locale nullable
There was a problem hiding this comment.
This would be a BC Break. It should be:
public function __construct(HttpAdapterInterface $adapter, $locale = null, $apiKey = null)There was a problem hiding this comment.
Ok, $locale will be null. I'm not sure what BC stands for, however, it seems what Baachi brought up, the constructor for BingMapsProvider will be a BC break too, for I copied by eye what the argument order was from that Provider.
There was a problem hiding this comment.
BC means Backward Compatibility
|
Ok, updated to reflect requested code changes. I just learned about Travis-CI and how this project is integrated with that system. That's beautiful. It seems there was a d/l issue with Php 5.4, the other versions were successful in the tests. |
|
So, it's ok, now you have to write a unit test. Add the following test in the /**
* @expectedException Geocoder\Exception\NoResultException
* @expectedExceptionMessage Could not find results for given query: http://www.mapquestapi.com/geocoding/v1/address?location=foobar&outFormat=json&maxResults=1&key=my-api-key'
*/
public function testGetGeocodedDataWithApiKey()
{
$provider = new MapQuestProvider($this->getMockAdapter(), 'my-api-key');
$provider->getGeocodedData('foobar');
} |
There was a problem hiding this comment.
is it correct by the way? the "end" looks weird:
';//Fmjtd|luub2d6tl9%2C2s%3Do5-9u22lr';
There was a problem hiding this comment.
Hrm, good catch, I missed removing that during debugging.
|
@icedstitch see https://travis-ci.org/willdurand/Geocoder/jobs/7187899#L78, the test may be not correct, or there is an issue with your code not using the right URL |
|
Agreed, I noticed it's using, strangely, the wrong url. I'm not in a place to fix it til maybe tonight at the soonest. |
|
Merged. Thank you! |
No tests were created, seemed too minor of
a tweak.
Just add the key as the second parameter if you have a key from www.mapquest.com.