1111
1212namespace Symfony \Component \Notifier \Tests \Transport ;
1313
14+ use PHPUnit \Framework \Attributes \DataProvider ;
1415use PHPUnit \Framework \TestCase ;
1516use Symfony \Component \Notifier \Exception \InvalidArgumentException ;
1617use Symfony \Component \Notifier \Exception \MissingRequiredOptionException ;
1718use Symfony \Component \Notifier \Transport \Dsn ;
1819
1920final class DsnTest extends TestCase
2021{
21- /**
22- * @dataProvider constructProvider
23- */
22+ #[DataProvider('constructProvider ' )]
2423 public function testConstruct (string $ dsnString , string $ scheme , string $ host , ?string $ user = null , ?string $ password = null , ?int $ port = null , array $ options = [], ?string $ path = null )
2524 {
2625 $ dsn = new Dsn ($ dsnString );
@@ -140,9 +139,7 @@ public static function constructProvider(): iterable
140139 ];
141140 }
142141
143- /**
144- * @dataProvider invalidDsnProvider
145- */
142+ #[DataProvider('invalidDsnProvider ' )]
146143 public function testInvalidDsn (string $ dsnString , string $ exceptionMessage )
147144 {
148145 $ this ->expectException (InvalidArgumentException::class);
@@ -169,9 +166,7 @@ public static function invalidDsnProvider(): iterable
169166 ];
170167 }
171168
172- /**
173- * @dataProvider getOptionProvider
174- */
169+ #[DataProvider('getOptionProvider ' )]
175170 public function testGetOption ($ expected , string $ dsnString , string $ option , ?string $ default = null )
176171 {
177172 $ dsn = new Dsn ($ dsnString );
@@ -207,9 +202,7 @@ public static function getOptionProvider(): iterable
207202 ];
208203 }
209204
210- /**
211- * @dataProvider getRequiredOptionProvider
212- */
205+ #[DataProvider('getRequiredOptionProvider ' )]
213206 public function testGetRequiredOption (string $ expectedValue , string $ options , string $ option )
214207 {
215208 $ dsn = new Dsn (\sprintf ('scheme://localhost?%s ' , $ options ));
@@ -232,9 +225,7 @@ public static function getRequiredOptionProvider(): iterable
232225 ];
233226 }
234227
235- /**
236- * @dataProvider getRequiredOptionThrowsMissingRequiredOptionExceptionProvider
237- */
228+ #[DataProvider('getRequiredOptionThrowsMissingRequiredOptionExceptionProvider ' )]
238229 public function testGetRequiredOptionThrowsMissingRequiredOptionException (string $ expectedExceptionMessage , string $ options , string $ option )
239230 {
240231 $ dsn = new Dsn (\sprintf ('scheme://localhost?%s ' , $ options ));
@@ -260,9 +251,7 @@ public static function getRequiredOptionThrowsMissingRequiredOptionExceptionProv
260251 ];
261252 }
262253
263- /**
264- * @dataProvider getBooleanOptionProvider
265- */
254+ #[DataProvider('getBooleanOptionProvider ' )]
266255 public function testGetBooleanOption (bool $ expected , string $ dsnString , string $ option , bool $ default )
267256 {
268257 $ dsn = new Dsn ($ dsnString );
0 commit comments