diff --git a/src/Chartjs/tests/Kernel/TwigAppKernel.php b/src/Chartjs/tests/Kernel/TwigAppKernel.php index 9b69148ad8e..e02c98fc855 100644 --- a/src/Chartjs/tests/Kernel/TwigAppKernel.php +++ b/src/Chartjs/tests/Kernel/TwigAppKernel.php @@ -34,7 +34,17 @@ public function registerBundles(): iterable public function registerContainerConfiguration(LoaderInterface $loader): void { $loader->load(function (ContainerBuilder $container) { - $container->loadFromExtension('framework', ['secret' => '$ecret', 'test' => true, 'http_method_override' => false]); + $container->loadFromExtension('framework', [ + 'secret' => '$ecret', + 'test' => true, + 'http_method_override' => false, + 'php_errors' => [ + 'log' => true, + ], + ...(self::VERSION_ID >= 60200 ? [ + 'handle_all_throwables' => true, + ] : []), + ]); $container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]); $container->setAlias('test.chartjs.builder', 'chartjs.builder')->setPublic(true); diff --git a/src/Cropperjs/tests/Kernel/FrameworkAppKernel.php b/src/Cropperjs/tests/Kernel/FrameworkAppKernel.php index 63535d3a2fb..2dd8364576a 100644 --- a/src/Cropperjs/tests/Kernel/FrameworkAppKernel.php +++ b/src/Cropperjs/tests/Kernel/FrameworkAppKernel.php @@ -42,12 +42,11 @@ public function registerContainerConfiguration(LoaderInterface $loader): void 'validation' => [ 'email_validation_mode' => 'html5', ], + ...(self::VERSION_ID >= 60200 ? [ + 'handle_all_throwables' => true, + ] : []), ]; - if (self::VERSION_ID >= 60200) { - $frameworkConfig['handle_all_throwables'] = true; - } - $container->loadFromExtension('framework', $frameworkConfig); }); } diff --git a/src/Cropperjs/tests/Kernel/TwigAppKernel.php b/src/Cropperjs/tests/Kernel/TwigAppKernel.php index 9b3a9ce84c3..c83baac6b4f 100644 --- a/src/Cropperjs/tests/Kernel/TwigAppKernel.php +++ b/src/Cropperjs/tests/Kernel/TwigAppKernel.php @@ -45,12 +45,11 @@ public function registerContainerConfiguration(LoaderInterface $loader): void 'validation' => [ 'email_validation_mode' => 'html5', ], + ...(self::VERSION_ID >= 60200 ? [ + 'handle_all_throwables' => true, + ] : []), ]; - if (self::VERSION_ID >= 60200) { - $frameworkConfig['handle_all_throwables'] = true; - } - $container->loadFromExtension('framework', $frameworkConfig); $container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]); diff --git a/src/Dropzone/tests/Kernel/FrameworkAppKernel.php b/src/Dropzone/tests/Kernel/FrameworkAppKernel.php index 0198c6743db..81f4f037c35 100644 --- a/src/Dropzone/tests/Kernel/FrameworkAppKernel.php +++ b/src/Dropzone/tests/Kernel/FrameworkAppKernel.php @@ -34,7 +34,13 @@ public function registerBundles(): iterable public function registerContainerConfiguration(LoaderInterface $loader): void { $loader->load(function (ContainerBuilder $container) { - $container->loadFromExtension('framework', ['secret' => '$ecret', 'test' => true]); + $container->loadFromExtension('framework', [ + 'secret' => '$ecret', + 'test' => true, + ...(self::VERSION_ID >= 70300 ? [ + 'property_info' => ['with_constructor_extractor' => false], + ] : []), + ]); }); } } diff --git a/src/Dropzone/tests/Kernel/TwigAppKernel.php b/src/Dropzone/tests/Kernel/TwigAppKernel.php index 0da830a90f8..7e64bf56a8d 100644 --- a/src/Dropzone/tests/Kernel/TwigAppKernel.php +++ b/src/Dropzone/tests/Kernel/TwigAppKernel.php @@ -37,7 +37,17 @@ public function registerBundles(): iterable public function registerContainerConfiguration(LoaderInterface $loader): void { $loader->load(function (ContainerBuilder $container) { - $container->loadFromExtension('framework', ['secret' => '$ecret', 'test' => true, 'http_method_override' => false]); + $container->loadFromExtension('framework', [ + 'secret' => '$ecret', + 'test' => true, + 'http_method_override' => false, + 'php_errors' => [ + 'log' => true, + ], + ...(self::VERSION_ID >= 60200 ? [ + 'handle_all_throwables' => true, + ] : []), + ]); $container->loadFromExtension('twig', [ 'default_path' => __DIR__.'/templates', 'strict_variables' => true, diff --git a/src/Icons/tests/Fixtures/TestKernel.php b/src/Icons/tests/Fixtures/TestKernel.php index 2f573439dd4..c0ecc320865 100644 --- a/src/Icons/tests/Fixtures/TestKernel.php +++ b/src/Icons/tests/Fixtures/TestKernel.php @@ -46,7 +46,12 @@ protected function configureContainer(ContainerConfigurator $container): void 'php_errors' => ['log' => true], 'property_access' => true, 'http_client' => true, - 'handle_all_throwables' => true, + ...(self::VERSION_ID >= 60200 ? [ + 'handle_all_throwables' => true, + ] : []), + ...(self::VERSION_ID >= 70300 ? [ + 'property_info' => ['with_constructor_extractor' => false], + ] : []), ]); $container->extension('twig', [ diff --git a/src/LazyImage/tests/Kernel/TwigAppKernel.php b/src/LazyImage/tests/Kernel/TwigAppKernel.php index 51869833765..680b66144f3 100644 --- a/src/LazyImage/tests/Kernel/TwigAppKernel.php +++ b/src/LazyImage/tests/Kernel/TwigAppKernel.php @@ -35,7 +35,17 @@ public function registerBundles(): iterable public function registerContainerConfiguration(LoaderInterface $loader): void { $loader->load(function (ContainerBuilder $container) { - $container->loadFromExtension('framework', ['secret' => '$ecret', 'test' => true, 'http_method_override' => false]); + $container->loadFromExtension('framework', [ + 'secret' => '$ecret', + 'test' => true, + 'http_method_override' => false, + 'php_errors' => [ + 'log' => true, + ], + ...(self::VERSION_ID >= 60200 ? [ + 'handle_all_throwables' => true, + ] : []), + ]); $container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]); $container->setAlias('test.lazy_image.blur_hash', 'lazy_image.blur_hash')->setPublic(true); diff --git a/src/LiveComponent/tests/Fixtures/Kernel.php b/src/LiveComponent/tests/Fixtures/Kernel.php index 1d45f78dc0f..57528fab3b6 100644 --- a/src/LiveComponent/tests/Fixtures/Kernel.php +++ b/src/LiveComponent/tests/Fixtures/Kernel.php @@ -103,10 +103,15 @@ protected function configureContainer(ContainerConfigurator $c): void 'validation' => [ 'email_validation_mode' => 'html5', ], + ...(self::VERSION_ID >= 60200 ? [ + 'handle_all_throwables' => true, + ] : []), + ...(self::VERSION_ID >= 70300 ? [ + 'property_info' => ['with_constructor_extractor' => false], + ] : []), ]; if (self::VERSION_ID >= 60400) { - $frameworkConfig['handle_all_throwables'] = true; $frameworkConfig['session'] = [ 'storage_factory_id' => 'session.storage.factory.mock_file', 'cookie_secure' => 'auto', @@ -143,7 +148,14 @@ protected function configureContainer(ContainerConfigurator $c): void 'anonymous_template_directory' => 'components/', ]); - $c->extension('zenstruck_foundry', []); + $foundryConfig = []; + if (null !== $doctrineBundleVersion = InstalledVersions::getVersion('zenstruck/foundry')) { + if (version_compare($doctrineBundleVersion, '2.5.0', '>=')) { + $doctrineConfig['persistence']['flush_once'] = true; + } + } + + $c->extension('zenstruck_foundry', $foundryConfig); $doctrineConfig = [ 'dbal' => [ diff --git a/src/Map/src/Test/RendererTestCase.php b/src/Map/src/Test/RendererTestCase.php index acb9685f2aa..e9c5009107d 100644 --- a/src/Map/src/Test/RendererTestCase.php +++ b/src/Map/src/Test/RendererTestCase.php @@ -13,6 +13,7 @@ use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; +use Spatie\Snapshots\Drivers\TextDriver; use Spatie\Snapshots\MatchesSnapshots; use Symfony\UX\Map\Elements; use Symfony\UX\Map\Map; @@ -40,7 +41,7 @@ public function testRenderMap(RendererInterface $renderer, Map $map, array $attr $rendered = $this->prettify($rendered); $this->assertElementsHaveComputedId($rendered); - $this->assertMatchesSnapshot($rendered); + $this->assertMatchesSnapshot($rendered, new TextDriver()); } private function prettify(string $html): string diff --git a/src/Map/tests/Kernel/FrameworkAppKernel.php b/src/Map/tests/Kernel/FrameworkAppKernel.php index 82704b4c3a5..ed177151fdb 100644 --- a/src/Map/tests/Kernel/FrameworkAppKernel.php +++ b/src/Map/tests/Kernel/FrameworkAppKernel.php @@ -35,7 +35,14 @@ public function registerBundles(): iterable public function registerContainerConfiguration(LoaderInterface $loader): void { $loader->load(function (ContainerBuilder $container) { - $container->loadFromExtension('framework', ['secret' => '$ecret', 'test' => true, 'http_method_override' => false]); + $container->loadFromExtension('framework', [ + 'secret' => '$ecret', + 'test' => true, + 'http_method_override' => false, + ...(self::VERSION_ID >= 70300 ? [ + 'property_info' => ['with_constructor_extractor' => false], + ] : []), + ]); $container->loadFromExtension('ux_map', []); $container->setAlias('test.ux_map.renderers', 'ux_map.renderers')->setPublic(true); diff --git a/src/Map/tests/Kernel/TwigAppKernel.php b/src/Map/tests/Kernel/TwigAppKernel.php index 8acc3816e5a..9854a1609c4 100644 --- a/src/Map/tests/Kernel/TwigAppKernel.php +++ b/src/Map/tests/Kernel/TwigAppKernel.php @@ -36,7 +36,17 @@ public function registerBundles(): iterable public function registerContainerConfiguration(LoaderInterface $loader): void { $loader->load(function (ContainerBuilder $container) { - $container->loadFromExtension('framework', ['secret' => '$ecret', 'test' => true, 'http_method_override' => false]); + $container->loadFromExtension('framework', [ + 'secret' => '$ecret', + 'test' => true, + 'http_method_override' => false, + 'php_errors' => [ + 'log' => true, + ], + ...(self::VERSION_ID >= 60200 ? [ + 'handle_all_throwables' => true, + ] : []), + ]); $container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]); $container->loadFromExtension('ux_map', []); diff --git a/src/Notify/tests/Kernel/TwigAppKernel.php b/src/Notify/tests/Kernel/TwigAppKernel.php index 8778cd86b76..d0b11dcc4af 100644 --- a/src/Notify/tests/Kernel/TwigAppKernel.php +++ b/src/Notify/tests/Kernel/TwigAppKernel.php @@ -39,7 +39,17 @@ public function registerBundles(): iterable public function registerContainerConfiguration(LoaderInterface $loader): void { $loader->load(function (ContainerBuilder $container) { - $container->loadFromExtension('framework', ['secret' => '$ecret', 'test' => true, 'http_method_override' => false]); + $container->loadFromExtension('framework', [ + 'secret' => '$ecret', + 'test' => true, + 'http_method_override' => false, + 'php_errors' => [ + 'log' => true, + ], + ...(self::VERSION_ID >= 60200 ? [ + 'handle_all_throwables' => true, + ] : []), + ]); $container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]); $container->loadFromExtension('mercure', [ 'hubs' => [ diff --git a/src/React/tests/Kernel/TwigAppKernel.php b/src/React/tests/Kernel/TwigAppKernel.php index 7b2602c9c3c..6ac9a4f470d 100644 --- a/src/React/tests/Kernel/TwigAppKernel.php +++ b/src/React/tests/Kernel/TwigAppKernel.php @@ -34,7 +34,17 @@ public function registerBundles(): iterable public function registerContainerConfiguration(LoaderInterface $loader): void { $loader->load(function (ContainerBuilder $container) { - $container->loadFromExtension('framework', ['secret' => '$ecret', 'test' => true, 'http_method_override' => false]); + $container->loadFromExtension('framework', [ + 'secret' => '$ecret', + 'test' => true, + 'http_method_override' => false, + 'php_errors' => [ + 'log' => true, + ], + ...(self::VERSION_ID >= 60200 ? [ + 'handle_all_throwables' => true, + ] : []), + ]); $container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]); $container->setAlias('test.twig', 'twig')->setPublic(true); diff --git a/src/StimulusBundle/tests/fixtures/StimulusTestKernel.php b/src/StimulusBundle/tests/fixtures/StimulusTestKernel.php index fea75c00201..ff8337f2ae6 100644 --- a/src/StimulusBundle/tests/fixtures/StimulusTestKernel.php +++ b/src/StimulusBundle/tests/fixtures/StimulusTestKernel.php @@ -63,7 +63,9 @@ protected function configureContainer(ContainerConfigurator $container): void 'importmap_path' => '%kernel.project_dir%/'.(class_exists(ImportMapConfigReader::class) ? 'importmap.php' : 'legacy/importmap.php'), ], 'test' => true, - 'handle_all_throwables' => true, + ...(self::VERSION_ID >= 60200 ? [ + 'handle_all_throwables' => true, + ] : []), 'php_errors' => ['log' => true], ]); diff --git a/src/Svelte/tests/Kernel/TwigAppKernel.php b/src/Svelte/tests/Kernel/TwigAppKernel.php index 6e2f8ed8ffa..c8a029e901c 100644 --- a/src/Svelte/tests/Kernel/TwigAppKernel.php +++ b/src/Svelte/tests/Kernel/TwigAppKernel.php @@ -35,7 +35,17 @@ public function registerBundles(): iterable public function registerContainerConfiguration(LoaderInterface $loader): void { $loader->load(function (ContainerBuilder $container) { - $container->loadFromExtension('framework', ['secret' => '$ecret', 'test' => true, 'http_method_override' => false]); + $container->loadFromExtension('framework', [ + 'secret' => '$ecret', + 'test' => true, + 'http_method_override' => false, + 'php_errors' => [ + 'log' => true, + ], + ...(self::VERSION_ID >= 60200 ? [ + 'handle_all_throwables' => true, + ] : []), + ]); $container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]); $container->setAlias('test.twig', 'twig')->setPublic(true); diff --git a/src/TogglePassword/tests/Kernel/TwigAppKernel.php b/src/TogglePassword/tests/Kernel/TwigAppKernel.php index 54db679bd6b..c5f6ce1fa4b 100644 --- a/src/TogglePassword/tests/Kernel/TwigAppKernel.php +++ b/src/TogglePassword/tests/Kernel/TwigAppKernel.php @@ -42,12 +42,14 @@ public function registerContainerConfiguration(LoaderInterface $loader): void 'php_errors' => [ 'log' => true, ], + ...(self::VERSION_ID >= 60200 ? [ + 'handle_all_throwables' => true, + ] : []), + ...(self::VERSION_ID >= 70300 ? [ + 'property_info' => ['with_constructor_extractor' => false], + ] : []), ]; - if (self::VERSION_ID >= 60200) { - $frameworkConfig['handle_all_throwables'] = true; - } - $container->loadFromExtension('framework', $frameworkConfig); $container->loadFromExtension('twig', [ 'default_path' => __DIR__.'/templates', diff --git a/src/Toolkit/tests/Fixtures/Kernel.php b/src/Toolkit/tests/Fixtures/Kernel.php index 6734bb54ea5..33b364fcc5a 100644 --- a/src/Toolkit/tests/Fixtures/Kernel.php +++ b/src/Toolkit/tests/Fixtures/Kernel.php @@ -50,8 +50,9 @@ protected function configureContainer(ContainerConfigurator $container): void 'php_errors' => ['log' => true], 'property_access' => true, 'http_client' => true, - 'handle_all_throwables' => true, - + ...(self::VERSION_ID >= 60200 ? [ + 'handle_all_throwables' => true, + ] : []), ...(self::VERSION_ID >= 70300 ? [ 'property_info' => ['with_constructor_extractor' => false], ] : []), diff --git a/src/TwigComponent/tests/Fixtures/Kernel.php b/src/TwigComponent/tests/Fixtures/Kernel.php index 1bd2d507c33..e320ecbaca7 100644 --- a/src/TwigComponent/tests/Fixtures/Kernel.php +++ b/src/TwigComponent/tests/Fixtures/Kernel.php @@ -45,10 +45,13 @@ protected function configureContainer(ContainerConfigurator $c): void 'secrets' => false, 'http_method_override' => false, 'php_errors' => ['log' => true], + ...(self::VERSION_ID >= 60200 ? [ + 'handle_all_throwables' => true, + ] : []), + ...(self::VERSION_ID >= 70300 ? [ + 'property_info' => ['with_constructor_extractor' => false], + ] : []), ]; - if (self::VERSION_ID >= 60200) { - $frameworkConfig['handle_all_throwables'] = true; - } $c->extension('framework', $frameworkConfig); $c->extension('twig', [ diff --git a/src/Vue/tests/Kernel/TwigAppKernel.php b/src/Vue/tests/Kernel/TwigAppKernel.php index 90ffedbaacc..f3abcc48a3f 100644 --- a/src/Vue/tests/Kernel/TwigAppKernel.php +++ b/src/Vue/tests/Kernel/TwigAppKernel.php @@ -35,7 +35,17 @@ public function registerBundles(): iterable public function registerContainerConfiguration(LoaderInterface $loader): void { $loader->load(function (ContainerBuilder $container) { - $container->loadFromExtension('framework', ['secret' => '$ecret', 'test' => true, 'http_method_override' => false]); + $container->loadFromExtension('framework', [ + 'secret' => '$ecret', + 'test' => true, + 'http_method_override' => false, + 'php_errors' => [ + 'log' => true, + ], + ...(self::VERSION_ID >= 60200 ? [ + 'handle_all_throwables' => true, + ] : []), + ]); $container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]); $container->setAlias('test.twig', 'twig')->setPublic(true);