@@ -18,7 +18,7 @@ class GeocoderServiceProviderTest extends TestCase
1818{
1919 public function testConfig ()
2020 {
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 ' ));
2222 $ this ->assertSame ('Geocoder\HttpAdapter\CurlHttpAdapter ' , $ this ->app ['config ' ]->get ('geocoder-laravel::adapter ' ));
2323 }
2424
@@ -35,13 +35,30 @@ public function testGeocoderDefaultAdapter()
3535 $ this ->assertInstanceOf ('Geocoder \\HttpAdapter \\CurlHttpAdapter ' , $ this ->app ['geocoder.adapter ' ]);
3636 }
3737
38+ public function testGeocoderChainProvider ()
39+ {
40+ $ this ->assertInstanceOf ('Geocoder \\Provider \\ChainProvider ' , $ this ->app ['geocoder.provider ' ]);
41+ }
42+
3843 public function testGeocoderDefaultProvider ()
3944 {
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+
4148 }
4249
4350 public function testGeocoder ()
4451 {
4552 $ this ->assertInstanceOf ('Geocoder \\Geocoder ' , $ this ->app ['geocoder ' ]);
4653 }
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+
4764}
0 commit comments