From 611ff59c3efa9b57b8e7af5d551f04c89c296507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 19 Feb 2018 16:01:42 +0100 Subject: [PATCH] [FrameworkBundle] Add missing XML config for circular_reference_handler. Add tests. --- .../Resources/config/schema/symfony-1.0.xsd | 1 + .../Tests/DependencyInjection/Fixtures/php/full.php | 1 + .../Tests/DependencyInjection/Fixtures/xml/full.xml | 2 +- .../Tests/DependencyInjection/Fixtures/yml/full.yml | 7 ++++--- .../Tests/DependencyInjection/FrameworkExtensionTest.php | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd index cca86f8c61..f81b7d225c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd @@ -230,6 +230,7 @@ + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php index a97daeef1d..64de9309e8 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php @@ -68,6 +68,7 @@ $container->loadFromExtension('framework', array( 'enabled' => true, 'enable_annotations' => true, 'name_converter' => 'serializer.name_converter.camel_case_to_snake_case', + 'circular_reference_handler' => 'my.circular.reference.handler', ), 'property_info' => true, 'ide' => 'file%%link%%format', diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml index 6920efebed..f083b9cb1a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml @@ -41,7 +41,7 @@ - + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml index 3194a0fab2..f54c3e6eb1 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml @@ -51,9 +51,10 @@ framework: debug: true file_cache_dir: '%kernel.cache_dir%/annotations' serializer: - enabled: true - enable_annotations: true - name_converter: serializer.name_converter.camel_case_to_snake_case + enabled: true + enable_annotations: true + name_converter: serializer.name_converter.camel_case_to_snake_case + circular_reference_handler: my.circular.reference.handler property_info: ~ ide: file%%link%%format request: diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index 576b885560..c78354ed08 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -781,6 +781,7 @@ abstract class FrameworkExtensionTest extends TestCase $this->assertNull($container->getDefinition('serializer.mapping.class_metadata_factory')->getArgument(1)); $this->assertEquals(new Reference('serializer.name_converter.camel_case_to_snake_case'), $container->getDefinition('serializer.normalizer.object')->getArgument(1)); $this->assertEquals(new Reference('property_info', ContainerBuilder::IGNORE_ON_INVALID_REFERENCE), $container->getDefinition('serializer.normalizer.object')->getArgument(3)); + $this->assertEquals(array('setCircularReferenceHandler', array(new Reference('my.circular.reference.handler'))), $container->getDefinition('serializer.normalizer.object')->getMethodCalls()[0]); } public function testRegisterSerializerExtractor()