diff --git a/src/CachePoolTest.php b/src/CachePoolTest.php index e5cb3e0..6f93f0e 100644 --- a/src/CachePoolTest.php +++ b/src/CachePoolTest.php @@ -11,6 +11,10 @@ namespace Cache\IntegrationTests; +use PHPUnit\Framework\Attributes\After; +use PHPUnit\Framework\Attributes\Before; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Psr\Cache\CacheItemInterface; use Psr\Cache\CacheItemPoolInterface; @@ -35,6 +39,7 @@ abstract public function createCachePool(); /** * @before */ + #[Before] public function setupService() { $this->cache = $this->createCachePool(); @@ -43,6 +48,7 @@ public function setupService() /** * @after */ + #[After] public function tearDownService() { if ($this->cache !== null) { @@ -488,6 +494,7 @@ public function testCommit() /** * @medium */ + #[Group('medium')] public function testExpiration() { if (isset($this->skippedTests[__FUNCTION__])) { @@ -567,6 +574,7 @@ public function testKeyLength() /** * @dataProvider invalidKeys */ + #[DataProvider('invalidKeys')] public function testGetItemInvalidKeys($key) { if (isset($this->skippedTests[__FUNCTION__])) { @@ -580,6 +588,7 @@ public function testGetItemInvalidKeys($key) /** * @dataProvider invalidKeys */ + #[DataProvider('invalidKeys')] public function testGetItemsInvalidKeys($key) { if (isset($this->skippedTests[__FUNCTION__])) { @@ -593,6 +602,7 @@ public function testGetItemsInvalidKeys($key) /** * @dataProvider invalidKeys */ + #[DataProvider('invalidKeys')] public function testHasItemInvalidKeys($key) { if (isset($this->skippedTests[__FUNCTION__])) { @@ -606,6 +616,7 @@ public function testHasItemInvalidKeys($key) /** * @dataProvider invalidKeys */ + #[DataProvider('invalidKeys')] public function testDeleteItemInvalidKeys($key) { if (isset($this->skippedTests[__FUNCTION__])) { @@ -619,6 +630,7 @@ public function testDeleteItemInvalidKeys($key) /** * @dataProvider invalidKeys */ + #[DataProvider('invalidKeys')] public function testDeleteItemsInvalidKeys($key) { if (isset($this->skippedTests[__FUNCTION__])) { @@ -857,6 +869,7 @@ public function testSavingObject() /** * @medium */ + #[Group('medium')] public function testHasItemReturnsFalseWhenDeferredItemIsExpired() { if (isset($this->skippedTests[__FUNCTION__])) { diff --git a/src/HierarchicalCachePoolTest.php b/src/HierarchicalCachePoolTest.php index 7413d1e..ef44d8f 100644 --- a/src/HierarchicalCachePoolTest.php +++ b/src/HierarchicalCachePoolTest.php @@ -11,6 +11,8 @@ namespace Cache\IntegrationTests; +use PHPUnit\Framework\Attributes\After; +use PHPUnit\Framework\Attributes\Before; use PHPUnit\Framework\TestCase; use Psr\Cache\CacheItemPoolInterface; @@ -37,6 +39,7 @@ abstract public function createCachePool(); /** * @before */ + #[Before] public function setupService() { $this->cache = $this->createCachePool(); @@ -45,6 +48,7 @@ public function setupService() /** * @after */ + #[After] public function tearDownService() { if ($this->cache !== null) { diff --git a/src/SimpleCacheTest.php b/src/SimpleCacheTest.php index 1d3216e..113fade 100644 --- a/src/SimpleCacheTest.php +++ b/src/SimpleCacheTest.php @@ -11,6 +11,10 @@ namespace Cache\IntegrationTests; +use PHPUnit\Framework\Attributes\After; +use PHPUnit\Framework\Attributes\Before; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Psr\SimpleCache\CacheInterface; @@ -49,6 +53,7 @@ public function advanceTime($seconds) /** * @before */ + #[Before] public function setupService() { $this->cache = $this->createSimpleCache(); @@ -57,6 +62,7 @@ public function setupService() /** * @after */ + #[After] public function tearDownService() { if ($this->cache !== null) { @@ -171,6 +177,7 @@ public function testSet() /** * @medium */ + #[Group('medium')] public function testSetTtl() { if (isset($this->skippedTests[__FUNCTION__])) { @@ -269,6 +276,7 @@ public function testSetMultipleWithIntegerArrayKey() /** * @medium */ + #[Group('medium')] public function testSetMultipleTtl() { if (isset($this->skippedTests[__FUNCTION__])) { @@ -441,6 +449,7 @@ public function testBasicUsageWithLongKey() /** * @dataProvider invalidKeys */ + #[DataProvider('invalidKeys')] public function testGetInvalidKeys($key) { if (isset($this->skippedTests[__FUNCTION__])) { @@ -454,6 +463,7 @@ public function testGetInvalidKeys($key) /** * @dataProvider invalidKeys */ + #[DataProvider('invalidKeys')] public function testGetMultipleInvalidKeys($key) { if (isset($this->skippedTests[__FUNCTION__])) { @@ -477,6 +487,7 @@ public function testGetMultipleNoIterable() /** * @dataProvider invalidKeys */ + #[DataProvider('invalidKeys')] public function testSetInvalidKeys($key) { if (isset($this->skippedTests[__FUNCTION__])) { @@ -490,6 +501,7 @@ public function testSetInvalidKeys($key) /** * @dataProvider invalidArrayKeys */ + #[DataProvider('invalidArrayKeys')] public function testSetMultipleInvalidKeys($key) { if (isset($this->skippedTests[__FUNCTION__])) { @@ -518,6 +530,7 @@ public function testSetMultipleNoIterable() /** * @dataProvider invalidKeys */ + #[DataProvider('invalidKeys')] public function testHasInvalidKeys($key) { if (isset($this->skippedTests[__FUNCTION__])) { @@ -531,6 +544,7 @@ public function testHasInvalidKeys($key) /** * @dataProvider invalidKeys */ + #[DataProvider('invalidKeys')] public function testDeleteInvalidKeys($key) { if (isset($this->skippedTests[__FUNCTION__])) { @@ -544,6 +558,7 @@ public function testDeleteInvalidKeys($key) /** * @dataProvider invalidKeys */ + #[DataProvider('invalidKeys')] public function testDeleteMultipleInvalidKeys($key) { if (isset($this->skippedTests[__FUNCTION__])) { @@ -567,6 +582,7 @@ public function testDeleteMultipleNoIterable() /** * @dataProvider invalidTtl */ + #[DataProvider('invalidTtl')] public function testSetInvalidTtl($ttl) { if (isset($this->skippedTests[__FUNCTION__])) { @@ -580,6 +596,7 @@ public function testSetInvalidTtl($ttl) /** * @dataProvider invalidTtl */ + #[DataProvider('invalidTtl')] public function testSetMultipleInvalidTtl($ttl) { if (isset($this->skippedTests[__FUNCTION__])) { @@ -699,6 +716,7 @@ public function testBinaryData() /** * @dataProvider validKeys */ + #[DataProvider('validKeys')] public function testSetValidKeys($key) { if (isset($this->skippedTests[__FUNCTION__])) { @@ -712,6 +730,7 @@ public function testSetValidKeys($key) /** * @dataProvider validKeys */ + #[DataProvider('validKeys')] public function testSetMultipleValidKeys($key) { if (isset($this->skippedTests[__FUNCTION__])) { @@ -732,6 +751,7 @@ public function testSetMultipleValidKeys($key) /** * @dataProvider validData */ + #[DataProvider('validData')] public function testSetValidData($data) { if (isset($this->skippedTests[__FUNCTION__])) { @@ -745,6 +765,7 @@ public function testSetValidData($data) /** * @dataProvider validData */ + #[DataProvider('validData')] public function testSetMultipleValidData($data) { if (isset($this->skippedTests[__FUNCTION__])) { diff --git a/src/TaggableCachePoolTest.php b/src/TaggableCachePoolTest.php index 73ed745..b56d727 100644 --- a/src/TaggableCachePoolTest.php +++ b/src/TaggableCachePoolTest.php @@ -12,6 +12,9 @@ namespace Cache\IntegrationTests; use Cache\TagInterop\TaggableCacheItemPoolInterface; +use PHPUnit\Framework\Attributes\After; +use PHPUnit\Framework\Attributes\Before; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -37,6 +40,7 @@ abstract public function createCachePool(); /** * @before */ + #[Before] public function setupService() { $this->cache = $this->createCachePool(); @@ -45,6 +49,7 @@ public function setupService() /** * @after */ + #[After] public function tearDownService() { if ($this->cache !== null) { @@ -133,6 +138,7 @@ public function testTagAccessorWithEmptyTag() /** * @dataProvider invalidKeys */ + #[DataProvider('invalidKeys')] public function testTagAccessorWithInvalidTag($tag) { if (isset($this->skippedTests[__FUNCTION__])) {