55namespace PhpMyAdmin \Tests ;
66
77use PhpMyAdmin \Cache ;
8+ use PHPUnit \Framework \Attributes \CoversClass ;
9+ use PHPUnit \Framework \Attributes \DataProvider ;
810use stdClass ;
911
10- /** @covers \PhpMyAdmin\ Cache */
12+ #[CoversClass( Cache::class)]
1113class CacheTest extends AbstractTestCase
1214{
1315 public function setUp (): void
@@ -25,7 +27,7 @@ public static function dataProviderCacheKeyValues(): array
2527 ];
2628 }
2729
28- /** @dataProvider dataProviderCacheKeyValues */
30+ #[DataProvider( ' dataProviderCacheKeyValues ' )]
2931 public function testCacheHas (string $ cacheKey , mixed $ valueToCache ): void
3032 {
3133 $ this ->assertFalse (Cache::has ($ cacheKey ));
@@ -35,7 +37,7 @@ public function testCacheHas(string $cacheKey, mixed $valueToCache): void
3537 $ this ->assertFalse (Cache::has ($ cacheKey ));
3638 }
3739
38- /** @dataProvider dataProviderCacheKeyValues */
40+ #[DataProvider( ' dataProviderCacheKeyValues ' )]
3941 public function testCachePurge (string $ cacheKey , mixed $ valueToCache ): void
4042 {
4143 $ this ->assertFalse (Cache::has ($ cacheKey ));
@@ -45,15 +47,15 @@ public function testCachePurge(string $cacheKey, mixed $valueToCache): void
4547 $ this ->assertFalse (Cache::has ($ cacheKey ));
4648 }
4749
48- /** @dataProvider dataProviderCacheKeyValues */
50+ #[DataProvider( ' dataProviderCacheKeyValues ' )]
4951 public function testCacheSet (string $ cacheKey , mixed $ valueToCache ): void
5052 {
5153 $ this ->assertFalse (Cache::has ($ cacheKey ));
5254 Cache::set ($ cacheKey , $ valueToCache );
5355 $ this ->assertTrue (Cache::has ($ cacheKey ));
5456 }
5557
56- /** @dataProvider dataProviderCacheKeyValues */
58+ #[DataProvider( ' dataProviderCacheKeyValues ' )]
5759 public function testCacheGet (string $ cacheKey , mixed $ valueToCache ): void
5860 {
5961 $ this ->assertFalse (Cache::has ($ cacheKey ));
@@ -62,7 +64,7 @@ public function testCacheGet(string $cacheKey, mixed $valueToCache): void
6264 $ this ->assertSame (Cache::get ($ cacheKey ), $ valueToCache );
6365 }
6466
65- /** @dataProvider dataProviderCacheKeyValues */
67+ #[DataProvider( ' dataProviderCacheKeyValues ' )]
6668 public function testCacheGetDefaultValue (string $ cacheKey , mixed $ valueToCache ): void
6769 {
6870 $ this ->assertFalse (Cache::has ($ cacheKey ));
@@ -77,7 +79,7 @@ public function testCacheGetDefaultValue(string $cacheKey, mixed $valueToCache):
7779 $ this ->assertFalse (Cache::get ($ cacheKey , false ));
7880 }
7981
80- /** @dataProvider dataProviderCacheKeyValues */
82+ #[DataProvider( ' dataProviderCacheKeyValues ' )]
8183 public function testCacheRemove (string $ cacheKey , mixed $ valueToCache ): void
8284 {
8385 $ this ->assertFalse (Cache::has ($ cacheKey ));
0 commit comments