We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cfaa228 + dfe6681 commit 2aafdafCopy full SHA for 2aafdaf
src/CachePoolTest.php
@@ -876,4 +876,21 @@ public function testSavingObject()
876
$value = $item->get();
877
$this->assertInstanceOf('DateTime', $value, 'You must be able to store objects in cache.');
878
}
879
+
880
+ public function testHasItemReturnsFalseWhenDeferredItemIsExpired()
881
+ {
882
+ if (isset($this->skippedTests[__FUNCTION__])) {
883
+ $this->markTestSkipped($this->skippedTests[__FUNCTION__]);
884
885
+ return;
886
+ }
887
888
+ $item = $this->cache->getItem('key');
889
+ $item->set('value');
890
+ $item->expiresAfter(2);
891
+ $this->cache->saveDeferred($item);
892
893
+ sleep(3);
894
+ $this->assertFalse($this->cache->hasItem('key'));
895
896
0 commit comments