1616use FOS \HttpCache \SymfonyCache \UserContextListener ;
1717use Mockery \Adapter \Phpunit \MockeryPHPUnitIntegration ;
1818use Mockery \MockInterface ;
19+ use PHPUnit \Framework \Attributes as PHPUnit ;
1920use PHPUnit \Framework \MockObject \MockObject ;
2021use PHPUnit \Framework \TestCase ;
2122use Symfony \Component \HttpFoundation \Request ;
@@ -55,9 +56,7 @@ public static function provideConfigOptions(): array
5556 ];
5657 }
5758
58- /**
59- * @dataProvider provideConfigOptions
60- */
59+ #[PHPUnit \DataProvider('provideConfigOptions ' )]
6160 public function testGenerateUserHashNotAllowed (array $ arg , array $ options ): void
6261 {
6362 $ userContextListener = new UserContextListener ($ arg );
@@ -74,9 +73,7 @@ public function testGenerateUserHashNotAllowed(array $arg, array $options): void
7473 $ this ->assertSame ('Bad Request ' , $ response ->getContent ());
7574 }
7675
77- /**
78- * @dataProvider provideConfigOptions
79- */
76+ #[PHPUnit \DataProvider('provideConfigOptions ' )]
8077 public function testPassingUserHashNotAllowed (array $ arg , array $ options ): void
8178 {
8279 $ userContextListener = new UserContextListener ($ arg );
@@ -93,9 +90,7 @@ public function testPassingUserHashNotAllowed(array $arg, array $options): void
9390 $ this ->assertSame ('Bad Request ' , $ response ->getContent ());
9491 }
9592
96- /**
97- * @dataProvider provideConfigOptions
98- */
93+ #[PHPUnit \DataProvider('provideConfigOptions ' )]
9994 public function testUserHashAnonymous (array $ arg , array $ options ): void
10095 {
10196 $ userContextListener = new UserContextListener ($ arg );
@@ -160,9 +155,7 @@ static function (Request $request) use ($that, $hashRequest) {
160155 $ this ->assertNull ($ response );
161156 }
162157
163- /**
164- * @dataProvider provideConfigOptions
165- */
158+ #[PHPUnit \DataProvider('provideConfigOptions ' )]
166159 public function testUserHashUserWithSession (array $ arg , array $ options ): void
167160 {
168161 $ userContextListener = new UserContextListener ($ arg );
@@ -256,9 +249,7 @@ public function testUserHashUserIgnoreCookies(): void
256249 $ this ->assertSame ('38015b703d82206ebc01d17a39c727e5 ' , $ request ->headers ->get ('X-User-Context-Hash ' ));
257250 }
258251
259- /**
260- * @dataProvider provideConfigOptions
261- */
252+ #[PHPUnit \DataProvider('provideConfigOptions ' )]
262253 public function testUserHashUserWithAuthorizationHeader (array $ arg , array $ options ): void
263254 {
264255 $ userContextListener = new UserContextListener ($ arg );
0 commit comments