1111
1212namespace Symfony \Bridge \Twig \Tests \Extension ;
1313
14+ use PHPUnit \Framework \Attributes \DataProvider ;
1415use PHPUnit \Framework \TestCase ;
1516use Symfony \Bridge \Twig \Extension \HttpFoundationExtension ;
1617use Symfony \Component \HttpFoundation \Request ;
2021
2122class HttpFoundationExtensionTest extends TestCase
2223{
23- /**
24- * @dataProvider getGenerateAbsoluteUrlData
25- */
24+ #[DataProvider('getGenerateAbsoluteUrlData ' )]
2625 public function testGenerateAbsoluteUrl ($ expected , $ path , $ pathinfo )
2726 {
2827 $ stack = new RequestStack ();
@@ -55,9 +54,7 @@ public static function getGenerateAbsoluteUrlData()
5554 ];
5655 }
5756
58- /**
59- * @dataProvider getGenerateAbsoluteUrlRequestContextData
60- */
57+ #[DataProvider('getGenerateAbsoluteUrlRequestContextData ' )]
6158 public function testGenerateAbsoluteUrlWithRequestContext ($ path , $ baseUrl , $ host , $ scheme , $ httpPort , $ httpsPort , $ expected )
6259 {
6360 $ requestContext = new RequestContext ($ baseUrl , 'GET ' , $ host , $ scheme , $ httpPort , $ httpsPort , $ path );
@@ -66,9 +63,7 @@ public function testGenerateAbsoluteUrlWithRequestContext($path, $baseUrl, $host
6663 $ this ->assertEquals ($ expected , $ extension ->generateAbsoluteUrl ($ path ));
6764 }
6865
69- /**
70- * @dataProvider getGenerateAbsoluteUrlRequestContextData
71- */
66+ #[DataProvider('getGenerateAbsoluteUrlRequestContextData ' )]
7267 public function testGenerateAbsoluteUrlWithoutRequestAndRequestContext ($ path )
7368 {
7469 $ extension = new HttpFoundationExtension (new UrlHelper (new RequestStack ()));
@@ -105,9 +100,7 @@ public function testGenerateAbsoluteUrlWithScriptFileName()
105100 );
106101 }
107102
108- /**
109- * @dataProvider getGenerateRelativePathData
110- */
103+ #[DataProvider('getGenerateRelativePathData ' )]
111104 public function testGenerateRelativePath ($ expected , $ path , $ pathinfo )
112105 {
113106 $ stack = new RequestStack ();
0 commit comments