1313
1414use PHPUnit \Framework \TestCase ;
1515use Symfony \Component \DependencyInjection \ContainerBuilder ;
16- use Symfony \Component \DependencyInjection \Exception \InvalidArgumentException ;
1716use Symfony \Component \Serializer \DependencyInjection \AttributeMetadataPass ;
1817use Symfony \Component \Serializer \Exception \MappingException ;
1918use Symfony \Component \Serializer \Mapping \Loader \AttributeLoader ;
@@ -52,18 +51,14 @@ public function testProcessWithTaggedServices()
5251 ->setArguments ([false , []]);
5352
5453 $ container ->register ('service1 ' , '%user_entity.class% ' )
55- ->addTag ('serializer.attribute_metadata ' )
56- ->addTag ('container.excluded ' );
54+ ->addTag ('serializer.attribute_metadata ' );
5755 $ container ->register ('service2 ' , 'App\Entity\Product ' )
58- ->addTag ('serializer.attribute_metadata ' )
59- ->addTag ('container.excluded ' );
56+ ->addTag ('serializer.attribute_metadata ' );
6057 $ container ->register ('service3 ' , 'App\Entity\Order ' )
61- ->addTag ('serializer.attribute_metadata ' )
62- ->addTag ('container.excluded ' );
58+ ->addTag ('serializer.attribute_metadata ' );
6359 // Classes should be deduplicated
6460 $ container ->register ('service4 ' , 'App\Entity\Order ' )
65- ->addTag ('serializer.attribute_metadata ' )
66- ->addTag ('container.excluded ' );
61+ ->addTag ('serializer.attribute_metadata ' );
6762
6863 (new AttributeMetadataPass ())->process ($ container );
6964
@@ -78,18 +73,6 @@ public function testProcessWithTaggedServices()
7873 $ this ->assertSame ([false , $ expectedClasses ], $ arguments );
7974 }
8075
81- public function testThrowsWhenMissingExcludedTag ()
82- {
83- $ container = new ContainerBuilder ();
84- $ container ->register ('serializer.mapping.attribute_loader ' );
85-
86- $ container ->register ('service_without_excluded ' , 'App \\Entity \\User ' )
87- ->addTag ('serializer.attribute_metadata ' );
88-
89- $ this ->expectException (InvalidArgumentException::class);
90- (new AttributeMetadataPass ())->process ($ container );
91- }
92-
9376 public function testProcessWithForOptionAndMatchingMembers ()
9477 {
9578 $ sourceClass = _AttrMeta_Source::class;
@@ -100,8 +83,7 @@ public function testProcessWithForOptionAndMatchingMembers()
10083 ->setArguments ([false , []]);
10184
10285 $ container ->register ('service.source ' , $ sourceClass )
103- ->addTag ('serializer.attribute_metadata ' , ['for ' => $ targetClass ])
104- ->addTag ('container.excluded ' );
86+ ->addTag ('serializer.attribute_metadata ' , ['for ' => $ targetClass ]);
10587
10688 (new AttributeMetadataPass ())->process ($ container );
10789
@@ -119,8 +101,7 @@ public function testProcessWithForOptionAndMissingMemberThrows()
119101 ->setArguments ([false , []]);
120102
121103 $ container ->register ('service.source ' , $ sourceClass )
122- ->addTag ('serializer.attribute_metadata ' , ['for ' => $ targetClass ])
123- ->addTag ('container.excluded ' );
104+ ->addTag ('serializer.attribute_metadata ' , ['for ' => $ targetClass ]);
124105
125106 $ this ->expectException (MappingException::class);
126107 (new AttributeMetadataPass ())->process ($ container );
0 commit comments