1212namespace Symfony \Component \OptionsResolver \Tests ;
1313
1414use PHPUnit \Framework \Assert ;
15+ use PHPUnit \Framework \Attributes \DataProvider ;
1516use PHPUnit \Framework \Attributes \Group ;
1617use PHPUnit \Framework \Attributes \IgnoreDeprecations ;
1718use PHPUnit \Framework \TestCase ;
@@ -35,9 +36,7 @@ protected function setUp(): void
3536 $ this ->resolver = new OptionsResolver ();
3637 }
3738
38- /**
39- * @dataProvider provideResolveWithIgnoreUndefined
40- */
39+ #[DataProvider('provideResolveWithIgnoreUndefined ' )]
4140 public function testResolveWithIgnoreUndefined (array $ defaults , array $ options , array $ expected )
4241 {
4342 $ this ->resolver
@@ -543,9 +542,7 @@ public function testIsNotDeprecatedIfEmptyString()
543542 $ this ->assertFalse ($ this ->resolver ->isDeprecated ('foo ' ));
544543 }
545544
546- /**
547- * @dataProvider provideDeprecationData
548- */
545+ #[DataProvider('provideDeprecationData ' )]
549546 public function testDeprecationMessages (\Closure $ configureOptions , array $ options , ?array $ expectedError , int $ expectedCount )
550547 {
551548 $ count = 0 ;
@@ -909,9 +906,7 @@ public function testResolveFailsWithCorrectLevelsButWrongScalar()
909906 ]);
910907 }
911908
912- /**
913- * @dataProvider provideInvalidTypes
914- */
909+ #[DataProvider('provideInvalidTypes ' )]
915910 public function testResolveFailsIfInvalidType ($ actualType , $ allowedType , $ exceptionMessage )
916911 {
917912 $ this ->resolver ->setDefined ('option ' );
@@ -2039,19 +2034,15 @@ public function testNestedArraysException()
20392034 ]);
20402035 }
20412036
2042- /**
2043- * @dataProvider provideValidDeeplyNestedUnionTypes
2044- */
2037+ #[DataProvider('provideValidDeeplyNestedUnionTypes ' )]
20452038 public function testDeeplyNestedUnionTypes (string $ type , $ validValue )
20462039 {
20472040 $ this ->resolver ->setDefined ('option ' );
20482041 $ this ->resolver ->setAllowedTypes ('option ' , $ type );
20492042 $ this ->assertEquals (['option ' => $ validValue ], $ this ->resolver ->resolve (['option ' => $ validValue ]));
20502043 }
20512044
2052- /**
2053- * @dataProvider provideInvalidDeeplyNestedUnionTypes
2054- */
2045+ #[DataProvider('provideInvalidDeeplyNestedUnionTypes ' )]
20552046 public function testDeeplyNestedUnionTypesException (string $ type , $ invalidValue , string $ expectedExceptionMessage )
20562047 {
20572048 $ this ->resolver ->setDefined ('option ' );
0 commit comments