From 2a46a7d515d278ffa80f48fcbefb64e32e4c7768 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 22 Jun 2024 13:31:15 +0200 Subject: [PATCH] fix tests --- .../FrameworkBundle/Tests/Functional/SerializerTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SerializerTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SerializerTest.php index 49019ab2a2b8c..9d75c5bf675a2 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SerializerTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SerializerTest.php @@ -44,6 +44,10 @@ public function testNormalizersAndEncodersUseDefaultContextConfigOption() $kernel = static::bootKernel(['test_case' => 'Serializer', 'root_config' => 'default_context.yaml']); foreach ($kernel->normalizersAndEncoders as $normalizerOrEncoderId) { + if (!static::getContainer()->has($normalizerOrEncoderId)) { + continue; + } + $normalizerOrEncoder = static::getContainer()->get($normalizerOrEncoderId); $reflectionObject = new \ReflectionObject($normalizerOrEncoder); @@ -68,7 +72,7 @@ class SerializerKernel extends AppKernel implements CompilerPassInterface 'serializer.normalizer.property.alias', // Special case as this normalizer isn't tagged ]; - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { $services = array_merge( $container->findTaggedServiceIds('serializer.normalizer'),