|
2 | 2 |
|
3 | 3 | use Toin0u\GeocoderLaravel\Tests\Laravel5_3\TestCase;
|
4 | 4 | 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; |
5 | 11 |
|
6 | 12 | class GeocoderServiceProviderTest extends TestCase
|
7 | 13 | {
|
@@ -81,4 +87,26 @@ public function testItThrowsAnExceptionForInvalidDumper()
|
81 | 87 |
|
82 | 88 | $this->assertEquals('1600', $jsonAddress->properties->streetNumber);
|
83 | 89 | }
|
| 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 | + } |
84 | 112 | }
|
0 commit comments