77use PHPUnit \Framework \TestCase ;
88use Symfony \Component \DependencyInjection \ChildDefinition ;
99use Symfony \Component \DependencyInjection \Definition ;
10- use Symfony \Component \DependencyInjection \DefinitionDecorator ;
1110
1211class DefinitionHasArgumentConstraintTest extends TestCase
1312{
1413 /**
1514 * @test
15+ *
1616 * @dataProvider definitionProvider
1717 */
1818 public function match (Definition $ definition , $ argumentIndex , $ expectedValue , $ shouldMatch ): void
@@ -22,7 +22,7 @@ public function match(Definition $definition, $argumentIndex, $expectedValue, $s
2222 $ this ->assertSame ($ shouldMatch , $ constraint ->evaluate ($ definition , '' , true ));
2323 }
2424
25- public function definitionProvider ()
25+ public static function definitionProvider ()
2626 {
2727 $ definitionWithNoArguments = new Definition ();
2828
@@ -33,11 +33,7 @@ public function definitionProvider()
3333 $ definitionWithArguments ->setArguments ($ arguments );
3434
3535 $ parentServiceId = 'parent_service_id ' ;
36- if (class_exists (ChildDefinition::class)) {
37- $ decoratedDefinitionWithArguments = new ChildDefinition ($ parentServiceId );
38- } else {
39- $ decoratedDefinitionWithArguments = new DefinitionDecorator ($ parentServiceId );
40- }
36+ $ decoratedDefinitionWithArguments = new ChildDefinition ($ parentServiceId );
4137
4238 $ decoratedDefinitionWithArguments ->setArguments ([0 => 'first argument ' , 1 => $ wrongValue ]);
4339 $ decoratedDefinitionWithArguments ->replaceArgument (1 , $ rightValue );
@@ -56,6 +52,7 @@ public function definitionProvider()
5652
5753 /**
5854 * @test
55+ *
5956 * @dataProvider invalid_definition_indexes
6057 *
6158 * @param mixed $argument
@@ -72,7 +69,7 @@ public function validates_definitionIndex($argument, $exceptionMessage): void
7269 /**
7370 * @return \Generator
7471 */
75- public function invalid_definition_indexes ()
72+ public static function invalid_definition_indexes ()
7673 {
7774 yield [
7875 new \stdClass (), 'Expected either a string or a positive integer for $argumentIndex. ' ,
@@ -97,6 +94,7 @@ public function invalid_definition_indexes()
9794
9895 /**
9996 * @test
97+ *
10098 * @dataProvider indexed_arguments
10199 *
102100 * @param int $argumentIndex
@@ -133,7 +131,7 @@ public function supports_indexed_arguments($argumentIndex): void
133131 /**
134132 * @return \Generator
135133 */
136- public function indexed_arguments ()
134+ public static function indexed_arguments ()
137135 {
138136 // yield [0];
139137 yield [1 ];
@@ -143,6 +141,7 @@ public function indexed_arguments()
143141
144142 /**
145143 * @test
144+ *
146145 * @dataProvider named_arguments
147146 *
148147 * @param string $argument
@@ -181,7 +180,7 @@ public function supports_named_arguments($argument): void
181180 /**
182181 * @return \Generator
183182 */
184- public function named_arguments ()
183+ public static function named_arguments ()
185184 {
186185 yield ['$foo ' ];
187186 yield ['$bar ' ];
0 commit comments