1313
1414use PHPUnit \Framework \TestCase ;
1515use Symfony \Component \DependencyInjection \ContainerBuilder ;
16- use Symfony \Component \DependencyInjection \Exception \InvalidArgumentException ;
1716use Symfony \Component \Validator \DependencyInjection \AttributeMetadataPass ;
1817use Symfony \Component \Validator \Exception \MappingException ;
1918
@@ -49,18 +48,14 @@ public function testProcessWithTaggedServices()
4948 ->addMethodCall ('addAttributeMappings ' , [[]]);
5049
5150 $ container ->register ('service1 ' , '%user_entity.class% ' )
52- ->addTag ('validator.attribute_metadata ' )
53- ->addTag ('container.excluded ' );
51+ ->addTag ('validator.attribute_metadata ' );
5452 $ container ->register ('service2 ' , 'App\Entity\Product ' )
55- ->addTag ('validator.attribute_metadata ' )
56- ->addTag ('container.excluded ' );
53+ ->addTag ('validator.attribute_metadata ' );
5754 $ container ->register ('service3 ' , 'App\Entity\Order ' )
58- ->addTag ('validator.attribute_metadata ' )
59- ->addTag ('container.excluded ' );
55+ ->addTag ('validator.attribute_metadata ' );
6056 // Classes should be deduplicated
6157 $ container ->register ('service4 ' , 'App\Entity\Order ' )
62- ->addTag ('validator.attribute_metadata ' )
63- ->addTag ('container.excluded ' );
58+ ->addTag ('validator.attribute_metadata ' );
6459
6560 (new AttributeMetadataPass ())->process ($ container );
6661
@@ -77,18 +72,6 @@ public function testProcessWithTaggedServices()
7772 $ this ->assertEquals ([$ expectedClasses ], $ methodCalls [1 ][1 ]);
7873 }
7974
80- public function testThrowsWhenMissingExcludedTag ()
81- {
82- $ container = new ContainerBuilder ();
83- $ container ->register ('validator.builder ' );
84-
85- $ container ->register ('service_without_excluded ' , 'App \\Entity \\User ' )
86- ->addTag ('validator.attribute_metadata ' );
87-
88- $ this ->expectException (InvalidArgumentException::class);
89- (new AttributeMetadataPass ())->process ($ container );
90- }
91-
9275 public function testProcessWithForOptionAndMatchingMembers ()
9376 {
9477 $ sourceClass = _AttrMeta_Source::class;
@@ -98,8 +81,7 @@ public function testProcessWithForOptionAndMatchingMembers()
9881 $ container ->register ('validator.builder ' );
9982
10083 $ container ->register ('service.source ' , $ sourceClass )
101- ->addTag ('validator.attribute_metadata ' , ['for ' => $ targetClass ])
102- ->addTag ('container.excluded ' );
84+ ->addTag ('validator.attribute_metadata ' , ['for ' => $ targetClass ]);
10385
10486 (new AttributeMetadataPass ())->process ($ container );
10587
@@ -118,8 +100,7 @@ public function testProcessWithForOptionAndMissingMemberThrows()
118100 $ container ->register ('validator.builder ' );
119101
120102 $ container ->register ('service.source ' , $ sourceClass )
121- ->addTag ('validator.attribute_metadata ' , ['for ' => $ targetClass ])
122- ->addTag ('container.excluded ' );
103+ ->addTag ('validator.attribute_metadata ' , ['for ' => $ targetClass ]);
123104
124105 $ this ->expectException (MappingException::class);
125106 (new AttributeMetadataPass ())->process ($ container );
0 commit comments