|
11 | 11 |
|
12 | 12 | namespace Cache\IntegrationTests;
|
13 | 13 |
|
14 |
| -use Cache\Adapter\Common\TaggableCacheItemPoolInterface; |
| 14 | +use Cache\TagInterop\TaggableCacheItemPoolInterface; |
15 | 15 |
|
16 | 16 | /**
|
17 | 17 | * @author Tobias Nyholm <[email protected]>
|
@@ -99,6 +99,25 @@ public function testPreviousTag()
|
99 | 99 | $this->assertCount(1, $item->getPreviousTags());
|
100 | 100 | }
|
101 | 101 |
|
| 102 | + public function testPreviousTagDeferred() |
| 103 | + { |
| 104 | + if (isset($this->skippedTests[__FUNCTION__])) { |
| 105 | + $this->markTestSkipped($this->skippedTests[__FUNCTION__]); |
| 106 | + |
| 107 | + return; |
| 108 | + } |
| 109 | + |
| 110 | + $item = $this->cache->getItem('key')->set('value'); |
| 111 | + $item->setTags(['tag0']); |
| 112 | + $this->assertCount(0, $item->getPreviousTags()); |
| 113 | + |
| 114 | + $this->cache->saveDeferred($item); |
| 115 | + $this->assertCount(0, $item->getPreviousTags()); |
| 116 | + |
| 117 | + $item = $this->cache->getItem('key'); |
| 118 | + $this->assertCount(1, $item->getPreviousTags()); |
| 119 | + } |
| 120 | + |
102 | 121 | /**
|
103 | 122 | * @expectedException \Psr\Cache\InvalidArgumentException
|
104 | 123 | */
|
@@ -260,6 +279,12 @@ public function testInvalidateTags()
|
260 | 279 | */
|
261 | 280 | public function testTagsAreCleanedOnSave()
|
262 | 281 | {
|
| 282 | + if (isset($this->skippedTests[__FUNCTION__])) { |
| 283 | + $this->markTestSkipped($this->skippedTests[__FUNCTION__]); |
| 284 | + |
| 285 | + return; |
| 286 | + } |
| 287 | + |
263 | 288 | $pool = $this->cache;
|
264 | 289 | $i = $pool->getItem('key')->set('value');
|
265 | 290 | $pool->save($i->setTags(['foo']));
|
|
0 commit comments