@@ -18,7 +18,7 @@ class GeocoderServiceProviderTest extends TestCase
18
18
{
19
19
public function testConfig ()
20
20
{
21
- $ this ->assertSame ('Geocoder\Provider\FreeGeoIpProvider ' , $ this ->app ['config ' ]->get ('geocoder-laravel::provider ' ));
21
+ $ this ->assertContains ('Geocoder\Provider\FreeGeoIpProvider ' , $ this ->app ['config ' ]->get ('geocoder-laravel::providers ' ));
22
22
$ this ->assertSame ('Geocoder\HttpAdapter\CurlHttpAdapter ' , $ this ->app ['config ' ]->get ('geocoder-laravel::adapter ' ));
23
23
}
24
24
@@ -35,13 +35,30 @@ public function testGeocoderDefaultAdapter()
35
35
$ this ->assertInstanceOf ('Geocoder \\HttpAdapter \\CurlHttpAdapter ' , $ this ->app ['geocoder.adapter ' ]);
36
36
}
37
37
38
+ public function testGeocoderChainProvider ()
39
+ {
40
+ $ this ->assertInstanceOf ('Geocoder \\Provider \\ChainProvider ' , $ this ->app ['geocoder.provider ' ]);
41
+ }
42
+
38
43
public function testGeocoderDefaultProvider ()
39
44
{
40
- $ this ->assertInstanceOf ('Geocoder \\Provider \\FreeGeoIpProvider ' , $ this ->app ['geocoder.provider ' ]);
45
+ $ providersArray = $ this ->getProtectedProperty ($ this ->app ['geocoder.provider ' ], 'providers ' );
46
+ $ this ->assertInstanceOf ('Geocoder \\Provider \\FreeGeoIpProvider ' , $ providersArray [0 ]);
47
+
41
48
}
42
49
43
50
public function testGeocoder ()
44
51
{
45
52
$ this ->assertInstanceOf ('Geocoder \\Geocoder ' , $ this ->app ['geocoder ' ]);
46
53
}
54
+
55
+ protected function getProtectedProperty ($ testObj , $ propertyName )
56
+ {
57
+ $ reflection = new \ReflectionClass ($ testObj );
58
+ $ property = $ reflection ->getProperty ($ propertyName );
59
+ $ property ->setAccessible (true );
60
+
61
+ return $ property ->getValue ($ testObj );
62
+ }
63
+
47
64
}
0 commit comments