Skip to content

Commit 379682d

Browse files
committed
Update tests
1 parent f115148 commit 379682d

File tree

4 files changed

+28
-135
lines changed

4 files changed

+28
-135
lines changed

tests/Geocoder/Facade/GeocoderTest.php

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

tests/Geocoder/GeocoderServiceProviderTest.php

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

tests/Geocoder/TestCase.php

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

tests/Laravel5_3/Providers/GeocoderServiceProviderTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
use Toin0u\GeocoderLaravel\Tests\Laravel5_3\TestCase;
44
use Toin0u\Geocoder\Exceptions\InvalidDumperException;
5+
use Toin0u\Geocoder\ProviderAndDumperAggregator;
6+
use Toin0u\Geocoder\GeocoderServiceProvider;
7+
use Geocoder\Provider\Chain;
8+
use Geocoder\Provider\FreeGeoIp;
9+
use Geocoder\Provider\GoogleMaps;
10+
use Ivory\HttpAdapter\CurlHttpAdapter;
511

612
class GeocoderServiceProviderTest extends TestCase
713
{
@@ -81,4 +87,26 @@ public function testItThrowsAnExceptionForInvalidDumper()
8187

8288
$this->assertEquals('1600', $jsonAddress->properties->streetNumber);
8389
}
90+
91+
public function testConfig()
92+
{
93+
$this->assertTrue(is_array($providers = $this->app['config']->get('geocoder.providers')));
94+
$this->assertCount(2, $providers);
95+
$this->assertArrayHasKey(GoogleMaps::class, $providers[Chain::class]);
96+
$this->assertArrayHasKey(FreeGeoIp::class, $providers[Chain::class]);
97+
$this->assertSame(CurlHttpAdapter::class, $this->app['config']->get('geocoder.adapter'));
98+
}
99+
100+
public function testLoadedProviders()
101+
{
102+
$loadedProviders = $this->app->getLoadedProviders();
103+
104+
$this->assertArrayHasKey(GeocoderServiceProvider::class, $loadedProviders);
105+
$this->assertTrue($loadedProviders[GeocoderServiceProvider::class]);
106+
}
107+
108+
public function testGeocoder()
109+
{
110+
$this->assertInstanceOf(ProviderAndDumperAggregator::class, app('geocoder'));
111+
}
84112
}

0 commit comments

Comments
 (0)