Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | public function testInvalidateByTag(): void |
||
17 | { |
||
18 | $cache = $this->getCache(); |
||
19 | $cache->set('item_42_price', 13, null, new TagDependency('item_42')); |
||
20 | $cache->set('item_42_total', 26, null, new TagDependency('item_42')); |
||
21 | |||
22 | $this->assertSame(13, $cache->get('item_42_price')); |
||
23 | $this->assertSame(26, $cache->get('item_42_total')); |
||
24 | |||
25 | TagDependency::invalidate($cache, 'item_42'); |
||
26 | |||
27 | // keys are invalidated but are still there |
||
28 | $this->assertTrue($cache->has('item_42_price')); |
||
29 | $this->assertTrue($cache->has('item_42_total')); |
||
30 | |||
31 | $this->assertNull($cache->get('item_42_price')); |
||
32 | $this->assertNull($cache->get('item_42_total')); |
||
33 | } |
||
35 |