Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Geocoder/Provider/BaiduProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class BaiduProvider extends AbstractHttpProvider implements Provider
/**
* @var string
*/
const GEOCODE_ENDPOINT_URL = 'http://api.map.baidu.com/geocoder?output=json&key=%s&address=%s';
const GEOCODE_ENDPOINT_URL = 'http://api.map.baidu.com/geocoder/v2/?output=json&pois=0&ak=%s&address=%s';

/**
* @var string
*/
const REVERSE_ENDPOINT_URL = 'http://api.map.baidu.com/geocoder?output=json&key=%s&location=%F,%F';
const REVERSE_ENDPOINT_URL = 'http://api.map.baidu.com/geocoder/v2/?output=json&pois=0&ak=%s&location=%F,%F';

/**
* @var string
Expand Down
12 changes: 6 additions & 6 deletions tests/Geocoder/Tests/Provider/BaiduProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testGeocodeWithNullApiKey()

/**
* @expectedException \Geocoder\Exception\NoResult
* @expectedExceptionMessage Could not execute query http://api.map.baidu.com/geocoder?output=json&key=api_key&address=
* @expectedExceptionMessage Could not execute query http://api.map.baidu.com/geocoder/v2/?output=json&pois=0&ak=api_key&address=
*/
public function testGeocodeWithNull()
{
Expand All @@ -37,7 +37,7 @@ public function testGeocodeWithNull()

/**
* @expectedException \Geocoder\Exception\NoResult
* @expectedExceptionMessage Could not execute query http://api.map.baidu.com/geocoder?output=json&key=api_key&address=
* @expectedExceptionMessage Could not execute query http://api.map.baidu.com/geocoder/v2/?output=json&pois=0&ak=api_key&address=
*/
public function testGeocodeWithEmpty()
{
Expand All @@ -47,7 +47,7 @@ public function testGeocodeWithEmpty()

/**
* @expectedException \Geocoder\Exception\NoResult
* @expectedExceptionMessage ould not execute query http://api.map.baidu.com/geocoder?output=json&key=api_key&address=%E7%99%BE%E5%BA%A6%E5%A4%A7%E5%8E%A6
* @expectedExceptionMessage ould not execute query http://api.map.baidu.com/geocoder/v2/?output=json&pois=0&ak=api_key&address=%E7%99%BE%E5%BA%A6%E5%A4%A7%E5%8E%A6
*/
public function testGeocodeWithAddressContentReturnNull()
{
Expand All @@ -57,7 +57,7 @@ public function testGeocodeWithAddressContentReturnNull()

/**
* @expectedException \Geocoder\Exception\NoResult
* @expectedExceptionMessage ould not execute query http://api.map.baidu.com/geocoder?output=json&key=api_key&address=%E7%99%BE%E5%BA%A6%E5%A4%A7%E5%8E%A6
* @expectedExceptionMessage ould not execute query http://api.map.baidu.com/geocoder/v2/?output=json&pois=0&ak=api_key&address=%E7%99%BE%E5%BA%A6%E5%A4%A7%E5%8E%A6
*/
public function testGeocodeWithAddress()
{
Expand Down Expand Up @@ -117,7 +117,7 @@ public function testGeocodeWithRealAddress()

/**
* @expectedException Geocoder\Exception\NoResult
* @expectedExceptionMessage Could not execute query http://api.map.baidu.com/geocoder?output=json&key=api_key&location=1.000000,2.000000
* @expectedExceptionMessage Could not execute query http://api.map.baidu.com/geocoder/v2/?output=json&pois=0&ak=api_key&location=1.000000,2.000000
*/
public function testReverse()
{
Expand All @@ -137,7 +137,7 @@ public function testReverseWithoutApiKey()

/**
* @expectedException \Geocoder\Exception\NoResult
* @expectedExceptionMessage Could not execute query http://api.map.baidu.com/geocoder?output=json&key=api_key&location=39.983424,116.322987
* @expectedExceptionMessage Could not execute query http://api.map.baidu.com/geocoder/v2/?output=json&pois=0&ak=api_key&location=39.983424,116.322987
*/
public function testReverseWithCoordinatesContentReturnNull()
{
Expand Down