|
14 | 14 |
|
15 | 15 | use Bazinga\GeocoderBundle\BazingaGeocoderBundle; |
16 | 16 | use Geocoder\Plugin\Plugin\CachePlugin; |
| 17 | +use Geocoder\Plugin\Plugin\LoggerPlugin; |
17 | 18 | use Geocoder\Plugin\PluginProvider; |
18 | 19 | use Geocoder\Provider\GoogleMaps\GoogleMaps; |
19 | 20 | use Geocoder\ProviderAggregator; |
@@ -81,4 +82,34 @@ public function testBundleWithCachedProvider() |
81 | 82 | $this->assertNotEmpty($plugins); |
82 | 83 | $this->assertInstanceOf(CachePlugin::class, $plugins[0]); |
83 | 84 | } |
| 85 | + |
| 86 | + public function testBundleWithPluginsYml() |
| 87 | + { |
| 88 | + $kernel = $this->createKernel(); |
| 89 | + $kernel->addConfigFile(__DIR__.'/config/service_plugin.yml'); |
| 90 | + $this->bootKernel(); |
| 91 | + $container = $this->getContainer(); |
| 92 | + |
| 93 | + $this->assertTrue($container->has('bazinga_geocoder.provider.acme')); |
| 94 | + $service = $container->get('bazinga_geocoder.provider.acme'); |
| 95 | + $this->assertInstanceOf(PluginProvider::class, $service); |
| 96 | + $plugins = NSA::getProperty($service, 'plugins'); |
| 97 | + $this->assertCount(3, $plugins); |
| 98 | + $this->assertInstanceOf(LoggerPlugin::class, $plugins[0]); |
| 99 | + } |
| 100 | + |
| 101 | + public function testBundleWithPluginXml() |
| 102 | + { |
| 103 | + $kernel = $this->createKernel(); |
| 104 | + $kernel->addConfigFile(__DIR__.'/config/service_plugin.xml'); |
| 105 | + $this->bootKernel(); |
| 106 | + $container = $this->getContainer(); |
| 107 | + |
| 108 | + $this->assertTrue($container->has('bazinga_geocoder.provider.acme')); |
| 109 | + $service = $container->get('bazinga_geocoder.provider.acme'); |
| 110 | + $this->assertInstanceOf(PluginProvider::class, $service); |
| 111 | + $plugins = NSA::getProperty($service, 'plugins'); |
| 112 | + $this->assertNotEmpty($plugins); |
| 113 | + $this->assertInstanceOf(LoggerPlugin::class, $plugins[0]); |
| 114 | + } |
84 | 115 | } |
0 commit comments