15
15
use FOS \HttpCacheBundle \Configuration \Tag ;
16
16
use FOS \HttpCacheBundle \EventListener \TagListener ;
17
17
use Mockery \Adapter \Phpunit \MockeryPHPUnitIntegration ;
18
+ use PHPUnit \Framework \Attributes as PHPUnit ;
18
19
use Symfony \Bundle \FrameworkBundle \Test \WebTestCase ;
19
20
use Symfony \Component \HttpFoundation \Request ;
20
21
use Symfony \Component \HttpFoundation \Response ;
@@ -143,9 +144,7 @@ public function testTwigExtension(): void
143
144
$ this ->assertEquals ('tag-from-twig ' , $ response ->headers ->get ('X-Cache-Tags ' ));
144
145
}
145
146
146
- /**
147
- * @dataProvider cacheableRequestResponseCombinations
148
- */
147
+ #[PHPUnit \DataProvider('cacheableRequestResponseCombinations ' )]
149
148
public function testTagsAreSetWhenCacheable (Request $ request , Response $ response ): void
150
149
{
151
150
self ::$ overrideService = true ;
@@ -175,9 +174,7 @@ public function testTagsAreSetWhenCacheable(Request $request, Response $response
175
174
$ this ->assertEquals ('cacheable-is-tagged ' , $ headers ->get ('X-Cache-Tags ' ));
176
175
}
177
176
178
- /**
179
- * @dataProvider mustInvalidateRequestResponseCombinations
180
- */
177
+ #[PHPUnit \DataProvider('mustInvalidateRequestResponseCombinations ' )]
181
178
public function testTagsAreInvalidated (Request $ request , Response $ response ): void
182
179
{
183
180
self ::$ overrideService = true ;
@@ -211,9 +208,7 @@ public function testTagsAreInvalidated(Request $request, Response $response): vo
211
208
$ this ->assertFalse ($ headers ->has ('X-Cache-Tags ' ));
212
209
}
213
210
214
- /**
215
- * @dataProvider mustNotInvalidateRequestResponseCombinations
216
- */
211
+ #[PHPUnit \DataProvider('mustNotInvalidateRequestResponseCombinations ' )]
217
212
public function testTagsAreNotInvalidated (Request $ request , Response $ response ): void
218
213
{
219
214
self ::$ overrideService = true ;
@@ -244,7 +239,7 @@ public function testTagsAreNotInvalidated(Request $request, Response $response):
244
239
$ this ->assertFalse ($ headers ->has ('X-Cache-Tags ' ));
245
240
}
246
241
247
- public function cacheableRequestResponseCombinations (): array
242
+ public static function cacheableRequestResponseCombinations (): array
248
243
{
249
244
return [
250
245
[Request::create ('' , 'GET ' ), new Response ('' , 200 )],
@@ -254,15 +249,15 @@ public function cacheableRequestResponseCombinations(): array
254
249
];
255
250
}
256
251
257
- public function mustInvalidateRequestResponseCombinations (): array
252
+ public static function mustInvalidateRequestResponseCombinations (): array
258
253
{
259
254
return [
260
255
// https://github.com/FriendsOfSymfony/FOSHttpCacheBundle/issues/241
261
256
[Request::create ('' , 'POST ' ), new Response ('' , 201 )],
262
257
];
263
258
}
264
259
265
- public function mustNotInvalidateRequestResponseCombinations (): array
260
+ public static function mustNotInvalidateRequestResponseCombinations (): array
266
261
{
267
262
return [
268
263
// https://github.com/FriendsOfSymfony/FOSHttpCacheBundle/issues/279
0 commit comments