1313namespace Bazinga \GeocoderBundle \Tests \Functional ;
1414
1515use Bazinga \GeocoderBundle \BazingaGeocoderBundle ;
16- use Bazinga \GeocoderBundle \Tests \PublicServicePass ;
1716use Geocoder \Dumper \GeoArray ;
1817use Geocoder \Dumper \GeoJson ;
1918use Geocoder \Dumper \Gpx ;
@@ -44,24 +43,22 @@ protected static function createKernel(array $options = []): KernelInterface
4443 */
4544 $ kernel = parent ::createKernel ($ options );
4645 $ kernel ->addTestBundle (BazingaGeocoderBundle::class);
47- $ kernel ->addTestCompilerPass (new PublicServicePass ('|[Bb]azinga:*| ' ));
48- $ kernel ->addTestCompilerPass (new PublicServicePass ('|[gG]eocoder:*| ' ));
4946 $ kernel ->handleOptions ($ options );
5047
5148 return $ kernel ;
5249 }
5350
5451 public function testInitBundle (): void
5552 {
56- $ kernel = self ::bootKernel (['config ' => static function (TestKernel $ kernel ) {
53+ self ::bootKernel (['config ' => static function (TestKernel $ kernel ) {
5754 $ kernel ->addTestConfig (__DIR__ .'/config/framework.yml ' );
5855
59- if ($ kernel ::VERSION_ID >= 50000 ) {
60- $ kernel ->addTestConfig (__DIR__ .'/config/framework_ ' .( $ kernel :: VERSION_ID >= 60000 ? ' sf6 ' : ' sf5 ' ). ' .yml ' );
56+ if ($ kernel ::VERSION_ID >= 60000 ) {
57+ $ kernel ->addTestConfig (__DIR__ .'/config/framework_sf6 .yml ' );
6158 }
6259 }]);
6360
64- $ container = method_exists ( __CLASS__ , ' getContainer ' ) ? self ::getContainer () : $ kernel -> getContainer ();
61+ $ container = self ::getContainer ();
6562
6663 // Test if services exists
6764 self ::assertTrue ($ container ->has (ProviderAggregator::class));
@@ -71,16 +68,17 @@ public function testInitBundle(): void
7168
7269 public function testBundleWithOneProviderConfiguration (): void
7370 {
74- $ kernel = self ::bootKernel (['config ' => static function (TestKernel $ kernel ) {
71+ self ::bootKernel (['config ' => static function (TestKernel $ kernel ) {
7572 $ kernel ->addTestConfig (__DIR__ .'/config/framework.yml ' );
76- $ kernel ->addTestConfig (__DIR__ .'/config/simple.yml ' );
7773
78- if ($ kernel ::VERSION_ID >= 50000 ) {
79- $ kernel ->addTestConfig (__DIR__ .'/config/framework_ ' .( $ kernel :: VERSION_ID >= 60000 ? ' sf6 ' : ' sf5 ' ). ' .yml ' );
74+ if ($ kernel ::VERSION_ID >= 60000 ) {
75+ $ kernel ->addTestConfig (__DIR__ .'/config/framework_sf6 .yml ' );
8076 }
77+
78+ $ kernel ->addTestConfig (__DIR__ .'/config/simple.yml ' );
8179 }]);
8280
83- $ container = method_exists ( __CLASS__ , ' getContainer ' ) ? self ::getContainer () : $ kernel -> getContainer ();
81+ $ container = self ::getContainer ();
8482
8583 self ::assertTrue ($ container ->has ('bazinga_geocoder.provider.acme ' ));
8684 $ service = $ container ->get ('bazinga_geocoder.provider.acme ' );
@@ -90,16 +88,17 @@ public function testBundleWithOneProviderConfiguration(): void
9088
9189 public function testBundleWithCachedProvider (): void
9290 {
93- $ kernel = self ::bootKernel (['config ' => static function (TestKernel $ kernel ) {
91+ self ::bootKernel (['config ' => static function (TestKernel $ kernel ) {
9492 $ kernel ->addTestConfig (__DIR__ .'/config/framework.yml ' );
95- $ kernel ->addTestConfig (__DIR__ .'/config/cache.yml ' );
9693
97- if ($ kernel ::VERSION_ID >= 50000 ) {
98- $ kernel ->addTestConfig (__DIR__ .'/config/framework_ ' .( $ kernel :: VERSION_ID >= 60000 ? ' sf6 ' : ' sf5 ' ). ' .yml ' );
94+ if ($ kernel ::VERSION_ID >= 60000 ) {
95+ $ kernel ->addTestConfig (__DIR__ .'/config/framework_sf6 .yml ' );
9996 }
97+
98+ $ kernel ->addTestConfig (__DIR__ .'/config/cache.yml ' );
10099 }]);
101100
102- $ container = method_exists ( __CLASS__ , ' getContainer ' ) ? self ::getContainer () : $ kernel -> getContainer ();
101+ $ container = self ::getContainer ();
103102
104103 self ::assertTrue ($ container ->has ('bazinga_geocoder.provider.acme ' ));
105104 $ service = $ container ->get ('bazinga_geocoder.provider.acme ' );
@@ -111,16 +110,17 @@ public function testBundleWithCachedProvider(): void
111110
112111 public function testCacheLifetimeCanBeNull (): void
113112 {
114- $ kernel = self ::bootKernel (['config ' => static function (TestKernel $ kernel ) {
113+ self ::bootKernel (['config ' => static function (TestKernel $ kernel ) {
115114 $ kernel ->addTestConfig (__DIR__ .'/config/framework.yml ' );
116- $ kernel ->addTestConfig (__DIR__ .'/config/cache_without_lifetime.yml ' );
117115
118- if ($ kernel ::VERSION_ID >= 50000 ) {
119- $ kernel ->addTestConfig (__DIR__ .'/config/framework_ ' .( $ kernel :: VERSION_ID >= 60000 ? ' sf6 ' : ' sf5 ' ). ' .yml ' );
116+ if ($ kernel ::VERSION_ID >= 60000 ) {
117+ $ kernel ->addTestConfig (__DIR__ .'/config/framework_sf6 .yml ' );
120118 }
119+
120+ $ kernel ->addTestConfig (__DIR__ .'/config/cache_without_lifetime.yml ' );
121121 }]);
122122
123- $ container = method_exists ( __CLASS__ , ' getContainer ' ) ? self ::getContainer () : $ kernel -> getContainer ();
123+ $ container = self ::getContainer ();
124124
125125 self ::assertTrue ($ container ->has ('bazinga_geocoder.provider.acme ' ));
126126
@@ -140,16 +140,17 @@ public function testCacheLifetimeCanBeNull(): void
140140
141141 public function testBundleWithPluginsYml (): void
142142 {
143- $ kernel = self ::bootKernel (['config ' => static function (TestKernel $ kernel ) {
143+ self ::bootKernel (['config ' => static function (TestKernel $ kernel ) {
144144 $ kernel ->addTestConfig (__DIR__ .'/config/framework.yml ' );
145- $ kernel ->addTestConfig (__DIR__ .'/config/service_plugin.yml ' );
146145
147- if ($ kernel ::VERSION_ID >= 50000 ) {
148- $ kernel ->addTestConfig (__DIR__ .'/config/framework_ ' .( $ kernel :: VERSION_ID >= 60000 ? ' sf6 ' : ' sf5 ' ). ' .yml ' );
146+ if ($ kernel ::VERSION_ID >= 60000 ) {
147+ $ kernel ->addTestConfig (__DIR__ .'/config/framework_sf6 .yml ' );
149148 }
149+
150+ $ kernel ->addTestConfig (__DIR__ .'/config/service_plugin.yml ' );
150151 }]);
151152
152- $ container = method_exists ( __CLASS__ , ' getContainer ' ) ? self ::getContainer () : $ kernel -> getContainer ();
153+ $ container = self ::getContainer ();
153154
154155 self ::assertTrue ($ container ->has ('bazinga_geocoder.provider.acme ' ));
155156 $ service = $ container ->get ('bazinga_geocoder.provider.acme ' );
@@ -161,16 +162,17 @@ public function testBundleWithPluginsYml(): void
161162
162163 public function testBundleWithPluginXml (): void
163164 {
164- $ kernel = self ::bootKernel (['config ' => static function (TestKernel $ kernel ) {
165+ self ::bootKernel (['config ' => static function (TestKernel $ kernel ) {
165166 $ kernel ->addTestConfig (__DIR__ .'/config/framework.yml ' );
166- $ kernel ->addTestConfig (__DIR__ .'/config/service_plugin.xml ' );
167167
168- if ($ kernel ::VERSION_ID >= 50000 ) {
169- $ kernel ->addTestConfig (__DIR__ .'/config/framework_ ' .( $ kernel :: VERSION_ID >= 60000 ? ' sf6 ' : ' sf5 ' ). ' .yml ' );
168+ if ($ kernel ::VERSION_ID >= 60000 ) {
169+ $ kernel ->addTestConfig (__DIR__ .'/config/framework_sf6 .yml ' );
170170 }
171+
172+ $ kernel ->addTestConfig (__DIR__ .'/config/service_plugin.xml ' );
171173 }]);
172174
173- $ container = method_exists ( __CLASS__ , ' getContainer ' ) ? self ::getContainer () : $ kernel -> getContainer ();
175+ $ container = self ::getContainer ();
174176
175177 self ::assertTrue ($ container ->has ('bazinga_geocoder.provider.acme ' ));
176178 $ service = $ container ->get ('bazinga_geocoder.provider.acme ' );
@@ -182,15 +184,15 @@ public function testBundleWithPluginXml(): void
182184
183185 public function testBundleHasRegisteredDumpers (): void
184186 {
185- $ kernel = self ::bootKernel (['config ' => static function (TestKernel $ kernel ) {
187+ self ::bootKernel (['config ' => static function (TestKernel $ kernel ) {
186188 $ kernel ->addTestConfig (__DIR__ .'/config/framework.yml ' );
187189
188- if ($ kernel ::VERSION_ID >= 50000 ) {
189- $ kernel ->addTestConfig (__DIR__ .'/config/framework_ ' .( $ kernel :: VERSION_ID >= 60000 ? ' sf6 ' : ' sf5 ' ). ' .yml ' );
190+ if ($ kernel ::VERSION_ID >= 60000 ) {
191+ $ kernel ->addTestConfig (__DIR__ .'/config/framework_sf6 .yml ' );
190192 }
191193 }]);
192194
193- $ container = method_exists ( __CLASS__ , ' getContainer ' ) ? self ::getContainer () : $ kernel -> getContainer ();
195+ $ container = self ::getContainer ();
194196
195197 self ::assertTrue ($ container ->has (GeoArray::class));
196198 self ::assertTrue ($ container ->has (GeoJson::class));
0 commit comments