Skip to content

Commit 964b7b2

Browse files
committed
Replace FreeGeoIP with GeoPlugin
1 parent 037f0cb commit 964b7b2

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

config/geocoder.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Geocoder\Provider\BingMaps\BingMaps;
1111
use Geocoder\Provider\Chain\Chain;
1212
use Geocoder\Provider\GeoPlugin\GeoPlugin;
13-
use Geocoder\Provider\FreeGeoIp\FreeGeoIp;
1413
use Geocoder\Provider\GoogleMaps\GoogleMaps;
1514

1615
return [
@@ -21,13 +20,12 @@
2120
'en-US',
2221
env('GOOGLE_MAPS_API_KEY'),
2322
],
24-
FreeGeoIp::class => [],
23+
GeoPlugin::class => [],
2524
],
2625
BingMaps::class => [
2726
'en-US',
2827
env('BING_MAPS_API_KEY'),
2928
],
30-
GeoPlugin::class => [],
3129
GoogleMaps::class => [
3230
'us',
3331
env('GOOGLE_MAPS_API_KEY'),

tests/Laravel5_3/Providers/GeocoderServiceTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Geocoder\Laravel\ProviderAndDumperAggregator;
88
use Geocoder\Laravel\Providers\GeocoderService;
99
use Geocoder\Provider\Chain\Chain;
10-
use Geocoder\Provider\FreeGeoIp\FreeGeoIp;
10+
use Geocoder\Provider\GeoPlugin\GeoPlugin;
1111
use Geocoder\Provider\MaxMindBinary\MaxMindBinary;
1212
use Geocoder\Provider\GoogleMaps\GoogleMaps;
1313
use Geocoder\Query\GeocodeQuery;
@@ -67,10 +67,8 @@ public function testItResolvesAGivenIPAddress()
6767

6868
// Act
6969
$results = app('geocoder')
70-
->using('geo_plugin')
7170
->geocode('72.229.28.185')
7271
->get();
73-
dump($results, app('geocoder'));
7472

7573
// Assert
7674
$this->assertEquals('US', $results->first()->getCountry()->getCode());
@@ -158,9 +156,9 @@ public function testConfig()
158156
{
159157
$this->assertEquals(999999999, config('geocoder.cache-duraction'));
160158
$this->assertTrue(is_array($providers = $this->app['config']->get('geocoder.providers')));
161-
$this->assertCount(4, $providers);
159+
$this->assertCount(3, $providers);
162160
$this->assertArrayHasKey(GoogleMaps::class, $providers[Chain::class]);
163-
$this->assertArrayHasKey(FreeGeoIp::class, $providers[Chain::class]);
161+
$this->assertArrayHasKey(GeoPlugin::class, $providers[Chain::class]);
164162
$this->assertSame(CurlAdapter::class, $this->app['config']->get('geocoder.adapter'));
165163
}
166164

@@ -265,7 +263,7 @@ public function testFetchingAllResults()
265263
public function testGetProviders()
266264
{
267265
$providers = app('geocoder')->getProviders();
268-
266+
269267
$this->assertTrue($providers->has('chain'));
270268
$this->assertTrue($providers->has('bing_maps'));
271269
$this->assertTrue($providers->has('google_maps'));

0 commit comments

Comments
 (0)