From f46109ad7e7495d0280b8702e265e4542f61fa7e Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Thu, 25 Sep 2025 09:17:43 +0200 Subject: [PATCH] Remove explicit configuration `twig.exception_controller` from Kernel for testing Related to https://github.com/symfony/symfony/pull/51273#discussion_r2359723452 --- src/Chartjs/tests/Kernel/TwigAppKernel.php | 5 ++++- src/Cropperjs/tests/Kernel/TwigAppKernel.php | 5 ++++- src/Dropzone/tests/Kernel/TwigAppKernel.php | 1 - src/LazyImage/tests/Kernel/TwigAppKernel.php | 5 ++++- src/Map/tests/Kernel/TwigAppKernel.php | 5 ++++- src/Map/tests/Kernel/TwigComponentKernel.php | 1 - src/Notify/tests/Kernel/TwigAppKernel.php | 5 ++++- src/React/tests/Kernel/TwigAppKernel.php | 5 ++++- src/Svelte/tests/Kernel/TwigAppKernel.php | 5 ++++- src/TogglePassword/tests/Kernel/TwigAppKernel.php | 1 - src/Vue/tests/Kernel/TwigAppKernel.php | 5 ++++- 11 files changed, 32 insertions(+), 11 deletions(-) diff --git a/src/Chartjs/tests/Kernel/TwigAppKernel.php b/src/Chartjs/tests/Kernel/TwigAppKernel.php index e02c98fc855..664f1590b6c 100644 --- a/src/Chartjs/tests/Kernel/TwigAppKernel.php +++ b/src/Chartjs/tests/Kernel/TwigAppKernel.php @@ -45,7 +45,10 @@ public function registerContainerConfiguration(LoaderInterface $loader): void 'handle_all_throwables' => true, ] : []), ]); - $container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]); + $container->loadFromExtension('twig', [ + 'default_path' => __DIR__.'/templates', + 'strict_variables' => true, + ]); $container->setAlias('test.chartjs.builder', 'chartjs.builder')->setPublic(true); $container->setAlias('test.chartjs.twig_extension', 'chartjs.twig_extension')->setPublic(true); diff --git a/src/Cropperjs/tests/Kernel/TwigAppKernel.php b/src/Cropperjs/tests/Kernel/TwigAppKernel.php index c83baac6b4f..e9f9fd29189 100644 --- a/src/Cropperjs/tests/Kernel/TwigAppKernel.php +++ b/src/Cropperjs/tests/Kernel/TwigAppKernel.php @@ -51,7 +51,10 @@ public function registerContainerConfiguration(LoaderInterface $loader): void ]; $container->loadFromExtension('framework', $frameworkConfig); - $container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]); + $container->loadFromExtension('twig', [ + 'default_path' => __DIR__.'/templates', + 'strict_variables' => true, + ]); // create a public alias - FormFactoryInterface is removed otherwise $container->setAlias('public_form_factory', new Alias(FormFactoryInterface::class, true)); diff --git a/src/Dropzone/tests/Kernel/TwigAppKernel.php b/src/Dropzone/tests/Kernel/TwigAppKernel.php index 7e64bf56a8d..988bb04ba88 100644 --- a/src/Dropzone/tests/Kernel/TwigAppKernel.php +++ b/src/Dropzone/tests/Kernel/TwigAppKernel.php @@ -54,7 +54,6 @@ public function registerContainerConfiguration(LoaderInterface $loader): void 'form_themes' => [ 'form_theme.html.twig', ], - 'exception_controller' => null, 'debug' => '%kernel.debug%', ]); diff --git a/src/LazyImage/tests/Kernel/TwigAppKernel.php b/src/LazyImage/tests/Kernel/TwigAppKernel.php index 680b66144f3..0c7398db939 100644 --- a/src/LazyImage/tests/Kernel/TwigAppKernel.php +++ b/src/LazyImage/tests/Kernel/TwigAppKernel.php @@ -46,7 +46,10 @@ public function registerContainerConfiguration(LoaderInterface $loader): void 'handle_all_throwables' => true, ] : []), ]); - $container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]); + $container->loadFromExtension('twig', [ + 'default_path' => __DIR__.'/templates', + 'strict_variables' => true, + ]); $container->setAlias('test.lazy_image.blur_hash', 'lazy_image.blur_hash')->setPublic(true); }); diff --git a/src/Map/tests/Kernel/TwigAppKernel.php b/src/Map/tests/Kernel/TwigAppKernel.php index 9854a1609c4..531e8a900dd 100644 --- a/src/Map/tests/Kernel/TwigAppKernel.php +++ b/src/Map/tests/Kernel/TwigAppKernel.php @@ -47,7 +47,10 @@ public function registerContainerConfiguration(LoaderInterface $loader): void 'handle_all_throwables' => true, ] : []), ]); - $container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]); + $container->loadFromExtension('twig', [ + 'default_path' => __DIR__.'/templates', + 'strict_variables' => true, + ]); $container->loadFromExtension('ux_map', []); $container->setAlias('test.ux_map.renderers', 'ux_map.renderers')->setPublic(true); diff --git a/src/Map/tests/Kernel/TwigComponentKernel.php b/src/Map/tests/Kernel/TwigComponentKernel.php index b1c590863a1..1cf8d5e9258 100644 --- a/src/Map/tests/Kernel/TwigComponentKernel.php +++ b/src/Map/tests/Kernel/TwigComponentKernel.php @@ -49,7 +49,6 @@ public function registerContainerConfiguration(LoaderInterface $loader): void $container->loadFromExtension('twig', [ 'default_path' => __DIR__.'/templates', 'strict_variables' => true, - 'exception_controller' => null, ]); $container->loadFromExtension('twig_component', [ 'defaults' => [], diff --git a/src/Notify/tests/Kernel/TwigAppKernel.php b/src/Notify/tests/Kernel/TwigAppKernel.php index d0b11dcc4af..d395697fa21 100644 --- a/src/Notify/tests/Kernel/TwigAppKernel.php +++ b/src/Notify/tests/Kernel/TwigAppKernel.php @@ -50,7 +50,10 @@ public function registerContainerConfiguration(LoaderInterface $loader): void 'handle_all_throwables' => true, ] : []), ]); - $container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]); + $container->loadFromExtension('twig', [ + 'default_path' => __DIR__.'/templates', + 'strict_variables' => true, + ]); $container->loadFromExtension('mercure', [ 'hubs' => [ 'default' => [ diff --git a/src/React/tests/Kernel/TwigAppKernel.php b/src/React/tests/Kernel/TwigAppKernel.php index 6ac9a4f470d..3b44ba30009 100644 --- a/src/React/tests/Kernel/TwigAppKernel.php +++ b/src/React/tests/Kernel/TwigAppKernel.php @@ -45,7 +45,10 @@ public function registerContainerConfiguration(LoaderInterface $loader): void 'handle_all_throwables' => true, ] : []), ]); - $container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]); + $container->loadFromExtension('twig', [ + 'default_path' => __DIR__.'/templates', + 'strict_variables' => true, + ]); $container->setAlias('test.twig', 'twig')->setPublic(true); $container->setAlias('test.twig.extension.react', 'twig.extension.react')->setPublic(true); diff --git a/src/Svelte/tests/Kernel/TwigAppKernel.php b/src/Svelte/tests/Kernel/TwigAppKernel.php index c8a029e901c..d6a4aa1d8ea 100644 --- a/src/Svelte/tests/Kernel/TwigAppKernel.php +++ b/src/Svelte/tests/Kernel/TwigAppKernel.php @@ -46,7 +46,10 @@ public function registerContainerConfiguration(LoaderInterface $loader): void 'handle_all_throwables' => true, ] : []), ]); - $container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]); + $container->loadFromExtension('twig', [ + 'default_path' => __DIR__.'/templates', + 'strict_variables' => true, + ]); $container->setAlias('test.twig', 'twig')->setPublic(true); $container->setAlias('test.twig.extension.svelte', 'twig.extension.svelte')->setPublic(true); diff --git a/src/TogglePassword/tests/Kernel/TwigAppKernel.php b/src/TogglePassword/tests/Kernel/TwigAppKernel.php index c5f6ce1fa4b..e1cf3c12f8a 100644 --- a/src/TogglePassword/tests/Kernel/TwigAppKernel.php +++ b/src/TogglePassword/tests/Kernel/TwigAppKernel.php @@ -54,7 +54,6 @@ public function registerContainerConfiguration(LoaderInterface $loader): void $container->loadFromExtension('twig', [ 'default_path' => __DIR__.'/templates', 'strict_variables' => true, - 'exception_controller' => null, 'debug' => '%kernel.debug%', ]); diff --git a/src/Vue/tests/Kernel/TwigAppKernel.php b/src/Vue/tests/Kernel/TwigAppKernel.php index f3abcc48a3f..ba09eb57460 100644 --- a/src/Vue/tests/Kernel/TwigAppKernel.php +++ b/src/Vue/tests/Kernel/TwigAppKernel.php @@ -46,7 +46,10 @@ public function registerContainerConfiguration(LoaderInterface $loader): void 'handle_all_throwables' => true, ] : []), ]); - $container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]); + $container->loadFromExtension('twig', [ + 'default_path' => __DIR__.'/templates', + 'strict_variables' => true, + ]); $container->setAlias('test.twig', 'twig')->setPublic(true); $container->setAlias('test.twig.extension.vue', 'twig.extension.vue')->setPublic(true);