2222use Symfony \Component \HttpFoundation \Response ;
2323use Symfony \Component \HttpKernel \Kernel ;
2424use Symfony \Component \HttpKernel \Log \Logger ;
25+ use Symfony \Component \Routing \Loader \Configurator \RoutingConfigurator ;
2526use Symfony \Component \Routing \RouteCollectionBuilder ;
2627use Symfony \WebpackEncoreBundle \Asset \EntrypointLookupCollectionInterface ;
2728use Symfony \WebpackEncoreBundle \Asset \EntrypointLookupInterface ;
@@ -177,7 +178,7 @@ public function testAutowireDefaultBuildArgument()
177178 }
178179}
179180
180- class WebpackEncoreIntegrationTestKernel extends Kernel
181+ abstract class AbstractWebpackEncoreIntegrationTestKernel extends Kernel
181182{
182183 use MicroKernelTrait;
183184
@@ -203,11 +204,6 @@ public function registerBundles()
203204 ];
204205 }
205206
206- protected function configureRoutes (RouteCollectionBuilder $ routes )
207- {
208- $ routes ->add ('/foo ' , 'kernel: ' .(parent ::VERSION_ID >= 40100 ? ': ' : '' ).'renderFoo ' );
209- }
210-
211207 protected function configureContainer (ContainerBuilder $ container , LoaderInterface $ loader )
212208 {
213209 $ container ->loadFromExtension ('framework ' , [
@@ -268,6 +264,22 @@ public function renderFoo()
268264 }
269265}
270266
267+ if (method_exists (AbstractWebpackEncoreIntegrationTestKernel::class, 'configureRouting ' )) {
268+ class WebpackEncoreIntegrationTestKernel extends AbstractWebpackEncoreIntegrationTestKernel {
269+ protected function configureRouting (RoutingConfigurator $ routes ): void
270+ {
271+ $ routes ->add ('/foo ' , 'kernel: ' .(parent ::VERSION_ID >= 40100 ? ': ' : '' ).'renderFoo ' );
272+ }
273+ }
274+ } else {
275+ class WebpackEncoreIntegrationTestKernel extends AbstractWebpackEncoreIntegrationTestKernel {
276+ protected function configureRoutes (RouteCollectionBuilder $ routes )
277+ {
278+ $ routes ->add ('/foo ' , 'kernel: ' .(parent ::VERSION_ID >= 40100 ? ': ' : '' ).'renderFoo ' );
279+ }
280+ }
281+ }
282+
271283class WebpackEncoreCacheWarmerTester
272284{
273285 private $ entrypointCacheWarmer ;
0 commit comments