diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2022-12-20 13:18:31 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2022-12-20 13:18:31 +0000 |
| commit | 71724582928190ecd5e0e9169a8eab557d8cd1bc (patch) | |
| tree | ed26d756ce7aea303bf78ea02b38ff01877464cb /tests | |
| parent | 181142fd5b5efb5842fb7fe4576accba85f87bee (diff) | |
allow StudipCachedArray to expire completely and use that in RolePersistence, fixes #1580
Closes #1580
Merge request studip/studip!1009
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit/lib/classes/StudipCachedArrayTest.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/unit/lib/classes/StudipCachedArrayTest.php b/tests/unit/lib/classes/StudipCachedArrayTest.php index e473dc6..c98c1bd 100644 --- a/tests/unit/lib/classes/StudipCachedArrayTest.php +++ b/tests/unit/lib/classes/StudipCachedArrayTest.php @@ -48,6 +48,21 @@ class StudipCachedArrayTest extends \Codeception\Test\Unit $this->assertFalse(isset($cache[$key])); } + /** + * @depends testStorage + * @dataProvider StorageProvider + */ + public function testExpiration($key, $value) + { + $cache = $this->getCachedArray(); + + $cache[$key] = $value; + + $cache->expire(); + + $this->assertFalse(isset($cache[$key])); + } + public function StorageProvider(): array { return [ |
