Skip to content

Commit c750c15

Browse files
committed
Update for 4.0 release, bring tests to green
1 parent 6c9e1c0 commit c750c15

File tree

5 files changed

+50
-21
lines changed

5 files changed

+50
-21
lines changed

composer.json

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,19 @@
2323
}
2424
],
2525
"require": {
26+
"geocoder-php/chain-provider": "^4.0",
27+
"geocoder-php/geo-plugin-provider": "^4.0",
28+
"geocoder-php/google-maps-provider": "^4.0",
2629
"illuminate/cache": "5.*",
2730
"illuminate/support": "5.*",
2831
"php": "^7.0",
29-
"php-http/message": "^1.5",
30-
"php-http/curl-client": "^1.7",
31-
"guzzlehttp/psr7": "^1.4",
32-
"geocoder-php/chain-provider": "dev-master@dev",
33-
"geocoder-php/bing-maps-provider": "dev-master@dev",
34-
"geocoder-php/geo-plugin-provider": "dev-master@dev",
35-
"geocoder-php/google-maps-provider": "dev-master@dev",
36-
"willdurand/geocoder": "dev-master as 4.0.0-beta2"
32+
"willdurand/geocoder": "^4.0"
3733
},
3834
"require-dev": {
3935
"doctrine/dbal": "^2.5",
4036
"fzaninotto/faker": "~1.4",
41-
"geocoder-php/maxmind-binary-provider": "dev-master@dev",
37+
"geocoder-php/bing-maps-provider": "^4.0",
38+
"geocoder-php/maxmind-binary-provider": "^4.0",
4239
"laravel/laravel": "5.4.*",
4340
"mockery/mockery": "0.9.*",
4441
"phpunit/phpunit": "~5.0",
@@ -56,8 +53,10 @@
5653
}
5754
},
5855
"extra": {
59-
"branch-alias": {
60-
"dev-master": "2.0.0-dev"
56+
"laravel": {
57+
"providers": [
58+
"Geocoder\\Laravel\\Providers\\GeocoderService"
59+
]
6160
}
6261
},
6362
"minimum-stability": "dev",

config/geocoder.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@
2222
],
2323
GeoPlugin::class => [],
2424
],
25-
BingMaps::class => [
26-
'en-US',
27-
env('BING_MAPS_API_KEY'),
28-
],
29-
GoogleMaps::class => [
30-
'us',
31-
env('GOOGLE_MAPS_API_KEY'),
32-
],
3325
],
3426
'adapter' => Client::class,
3527
];

tests/Laravel5_3/Providers/GeocoderServiceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ public function testItResolvesAGivenIPAddress()
6767

6868
// Act
6969
$results = app('geocoder')
70-
->geocode('72.229.28.185')
70+
->geocode('8.8.8.8')
7171
->get();
7272

7373
// Assert
74-
$this->assertEquals('US', $results->first()->getCountry()->getCode());
7574
$this->assertTrue($results->isNotEmpty());
75+
$this->assertEquals('US', $results->first()->getCountry()->getCode());
7676
}
7777

7878
public function testItResolvesAGivenAddressWithUmlauts()

tests/Laravel5_3/TestCase.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ public function createApplication()
1919
{
2020
$app = require __DIR__ . '/../../vendor/laravel/laravel/bootstrap/app.php';
2121
$app->make(Kernel::class)->bootstrap();
22+
config([
23+
'geocoder' => include(__DIR__ . '/../assets/testConfig.php'),
24+
]);
2225

2326
return $app;
2427
}

tests/assets/testConfig.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
/**
4+
* This file is part of the GeocoderLaravel library.
5+
* For the full copyright and license information, please view the LICENSE
6+
* file that was distributed with this source code.
7+
*/
8+
9+
use Http\Client\Curl\Client;
10+
use Geocoder\Provider\BingMaps\BingMaps;
11+
use Geocoder\Provider\Chain\Chain;
12+
use Geocoder\Provider\GeoPlugin\GeoPlugin;
13+
use Geocoder\Provider\GoogleMaps\GoogleMaps;
14+
15+
return [
16+
'cache-duraction' => 999999999,
17+
'providers' => [
18+
Chain::class => [
19+
GoogleMaps::class => [
20+
'en-US',
21+
env('GOOGLE_MAPS_API_KEY'),
22+
],
23+
GeoPlugin::class => [],
24+
],
25+
BingMaps::class => [
26+
'en-US',
27+
env('BING_MAPS_API_KEY'),
28+
],
29+
GoogleMaps::class => [
30+
'us',
31+
env('GOOGLE_MAPS_API_KEY'),
32+
],
33+
],
34+
'adapter' => Client::class,
35+
];

0 commit comments

Comments
 (0)