@@ -742,7 +742,7 @@ public function testSerializerEnabled()
742742
743743 $ argument = $ container ->getDefinition ('serializer.mapping.chain_loader ' )->getArgument (0 );
744744
745- $ this ->assertCount (1 , $ argument );
745+ $ this ->assertCount (2 , $ argument );
746746 $ this ->assertEquals ('Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader ' , $ argument [0 ]->getClass ());
747747 $ this ->assertNull ($ container ->getDefinition ('serializer.mapping.class_metadata_factory ' )->getArgument (1 ));
748748 $ this ->assertEquals (new Reference ('serializer.name_converter.camel_case_to_snake_case ' ), $ container ->getDefinition ('serializer.normalizer.object ' )->getArgument (1 ));
@@ -839,23 +839,33 @@ public function testSerializerCacheDisabled()
839839 public function testSerializerMapping ()
840840 {
841841 $ container = $ this ->createContainerFromFile ('serializer_mapping ' , array ('kernel.bundles_metadata ' => array ('TestBundle ' => array ('namespace ' => 'Symfony \\Bundle \\FrameworkBundle \\Tests ' , 'path ' => __DIR__ .'/Fixtures/TestBundle ' ))));
842+ $ projectDir = $ container ->getParameter ('kernel.project_dir ' );
842843 $ configDir = __DIR__ .'/Fixtures/TestBundle/Resources/config ' ;
843844 $ expectedLoaders = array (
844845 new Definition (AnnotationLoader::class, array (new Reference ('annotation_reader ' ))),
845846 new Definition (XmlFileLoader::class, array ($ configDir .'/serialization.xml ' )),
846847 new Definition (YamlFileLoader::class, array ($ configDir .'/serialization.yml ' )),
848+ new Definition (YamlFileLoader::class, array ($ projectDir .'/config/serializer/foo.yml ' )),
847849 new Definition (XmlFileLoader::class, array ($ configDir .'/serializer_mapping/files/foo.xml ' )),
848850 new Definition (YamlFileLoader::class, array ($ configDir .'/serializer_mapping/files/foo.yml ' )),
849851 new Definition (YamlFileLoader::class, array ($ configDir .'/serializer_mapping/serialization.yml ' )),
850852 new Definition (YamlFileLoader::class, array ($ configDir .'/serializer_mapping/serialization.yaml ' )),
851853 );
852854
853855 foreach ($ expectedLoaders as $ definition ) {
856+ if (is_file ($ arg = $ definition ->getArgument (0 ))) {
857+ $ definition ->replaceArgument (0 , str_replace ('/ ' , DIRECTORY_SEPARATOR , $ arg ));
858+ }
854859 $ definition ->setPublic (false );
855860 }
856861
857862 $ loaders = $ container ->getDefinition ('serializer.mapping.chain_loader ' )->getArgument (0 );
858- $ this ->assertEquals (sort ($ expectedLoaders ), sort ($ loaders ));
863+ foreach ($ loaders as $ loader ) {
864+ if (is_file ($ arg = $ loader ->getArgument (0 ))) {
865+ $ loader ->replaceArgument (0 , str_replace ('/ ' , DIRECTORY_SEPARATOR , $ arg ));
866+ }
867+ }
868+ $ this ->assertEquals ($ expectedLoaders , $ loaders );
859869 }
860870
861871 public function testAssetHelperWhenAssetsAreEnabled ()
0 commit comments