diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SerializerTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SerializerTest.php index 49019ab2a2b8..9d75c5bf675a 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'),