@@ -749,7 +749,7 @@ public function testSerializerEnabled()
749749
750750 $ argument = $ container ->getDefinition ('serializer.mapping.chain_loader ' )->getArgument (0 );
751751
752- $ this ->assertCount (1 , $ argument );
752+ $ this ->assertCount (2 , $ argument );
753753 $ this ->assertEquals ('Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader ' , $ argument [0 ]->getClass ());
754754 $ this ->assertNull ($ container ->getDefinition ('serializer.mapping.class_metadata_factory ' )->getArgument (1 ));
755755 $ this ->assertEquals (new Reference ('serializer.name_converter.camel_case_to_snake_case ' ), $ container ->getDefinition ('serializer.normalizer.object ' )->getArgument (1 ));
@@ -861,23 +861,33 @@ public function testDeprecatedSerializerCacheOption()
861861 public function testSerializerMapping ()
862862 {
863863 $ container = $ this ->createContainerFromFile ('serializer_mapping ' , array ('kernel.bundles_metadata ' => array ('TestBundle ' => array ('namespace ' => 'Symfony \\Bundle \\FrameworkBundle \\Tests ' , 'path ' => __DIR__ .'/Fixtures/TestBundle ' , 'parent ' => null ))));
864+ $ projectDir = $ container ->getParameter ('kernel.project_dir ' );
864865 $ configDir = __DIR__ .'/Fixtures/TestBundle/Resources/config ' ;
865866 $ expectedLoaders = array (
866867 new Definition (AnnotationLoader::class, array (new Reference ('annotation_reader ' ))),
867868 new Definition (XmlFileLoader::class, array ($ configDir .'/serialization.xml ' )),
868869 new Definition (YamlFileLoader::class, array ($ configDir .'/serialization.yml ' )),
870+ new Definition (YamlFileLoader::class, array ($ projectDir .'/config/serializer/foo.yml ' )),
869871 new Definition (XmlFileLoader::class, array ($ configDir .'/serializer_mapping/files/foo.xml ' )),
870872 new Definition (YamlFileLoader::class, array ($ configDir .'/serializer_mapping/files/foo.yml ' )),
871873 new Definition (YamlFileLoader::class, array ($ configDir .'/serializer_mapping/serialization.yml ' )),
872874 new Definition (YamlFileLoader::class, array ($ configDir .'/serializer_mapping/serialization.yaml ' )),
873875 );
874876
875877 foreach ($ expectedLoaders as $ definition ) {
878+ if (is_file ($ arg = $ definition ->getArgument (0 ))) {
879+ $ definition ->replaceArgument (0 , strtr ($ arg , '/ ' , DIRECTORY_SEPARATOR ));
880+ }
876881 $ definition ->setPublic (false );
877882 }
878883
879884 $ loaders = $ container ->getDefinition ('serializer.mapping.chain_loader ' )->getArgument (0 );
880- $ this ->assertEquals (sort ($ expectedLoaders ), sort ($ loaders ));
885+ foreach ($ loaders as $ loader ) {
886+ if (is_file ($ arg = $ loader ->getArgument (0 ))) {
887+ $ loader ->replaceArgument (0 , strtr ($ arg , '/ ' , DIRECTORY_SEPARATOR ));
888+ }
889+ }
890+ $ this ->assertEquals ($ expectedLoaders , $ loaders );
881891 }
882892
883893 public function testAssetHelperWhenAssetsAreEnabled ()
0 commit comments