@@ -18,6 +18,8 @@ class BazingaGeocoderExtensionTest extends \PHPUnit_Framework_TestCase
1818 public function testLoad ()
1919 {
2020 $ configs = Yaml::parse (file_get_contents (__DIR__ .'/Fixtures/config.yml ' ));
21+ unset($ configs ['bazinga_geocoder ' ]['default_provider ' ]);
22+
2123 $ container = new ContainerBuilder ();
2224 $ extension = new BazingaGeocoderExtension ();
2325
@@ -46,6 +48,8 @@ public function testLoad()
4648 $ this ->assertTrue ($ dumperManager ->has ($ name ));
4749 }
4850
51+ $ this ->assertFalse ($ container ->hasParameter ('bazinga_geocoder.default_provider ' ));
52+
4953 $ geocoder = $ container ->get ('bazinga_geocoder.geocoder ' );
5054 $ providers = $ geocoder ->getProviders ();
5155 foreach (array (
@@ -75,6 +79,24 @@ public function testLoad()
7579 }
7680 }
7781
82+ public function testDefaultProvider ()
83+ {
84+ $ configs = Yaml::parse (file_get_contents (__DIR__ .'/Fixtures/config.yml ' ));
85+ $ container = new ContainerBuilder ();
86+ $ extension = new BazingaGeocoderExtension ();
87+
88+ $ container ->setParameter ('fixtures_dir ' , __DIR__ . '/Fixtures ' );
89+
90+ $ container ->set ('doctrine.apc.cache ' , new ArrayCache ());
91+
92+ $ container ->addCompilerPass (new AddProvidersPass ());
93+ $ extension ->load ($ configs , $ container );
94+
95+ $ container ->compile ();
96+
97+ $ this ->assertEquals ('bing_maps ' , $ container ->getParameter ('bazinga_geocoder.default_provider ' ));
98+ }
99+
78100 public function testLoadingFakeIpOldWay ()
79101 {
80102 $ configs = Yaml::parse (file_get_contents (__DIR__ .'/Fixtures/old_fake_ip.yml ' ));
0 commit comments