Skip to content

Commit 6ea8e12

Browse files
committed
Merge pull request #46 from Nyholm/bugfixes-tagging
Bugfixes tagging
2 parents f06618d + b842cc0 commit 6ea8e12

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/CachePoolTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ public function testSaveExpired()
343343

344344
$item = $this->cache->getItem('key');
345345
$item->set('value');
346-
$item->expiresAt(\DateTime::createFromFormat('U', time()));
346+
$item->expiresAt(\DateTime::createFromFormat('U', time() - 1));
347347
$this->cache->save($item);
348348
$item = $this->cache->getItem('key');
349349
$this->assertFalse($item->isHit(), 'Cache should not save expired items');
@@ -408,7 +408,7 @@ public function testDeferredExpired()
408408

409409
$item = $this->cache->getItem('key');
410410
$item->set('4711');
411-
$item->expiresAt(\DateTime::createFromFormat('U', time()));
411+
$item->expiresAt(\DateTime::createFromFormat('U', time() - 1));
412412
$this->cache->saveDeferred($item);
413413

414414
$this->assertFalse($this->cache->hasItem('key'), 'Cache should not have expired deferred item');

src/TaggableCachePoolTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function testBasicUsage()
6262
$this->cache->clearTags(['tag1']);
6363

6464
// The item should be removed
65-
$this->assertFalse($this->cache->hasItem('key'));
65+
$this->assertFalse($this->cache->hasItem('key'), 'Tags does not seams to be saved');
6666
}
6767

6868
public function testMultipleTags()
@@ -124,15 +124,15 @@ public function testRemoveTagWhenItemIsRemoved()
124124
return;
125125
}
126126

127-
$item = $this->cache->getItem('key');
127+
$item = $this->cache->getItem('key')->set('value');
128128
$item->setTags(['tag1']);
129129

130130
// Save the item and then delete it
131131
$this->cache->save($item);
132132
$this->cache->deleteItem('key');
133133

134134
// Create a new item (no tags)
135-
$item = $this->cache->getItem('key');
135+
$item = $this->cache->getItem('key')->set('value');
136136
$this->cache->save($item);
137137

138138
// Clear the tag
@@ -148,14 +148,14 @@ public function testClear()
148148
return;
149149
}
150150

151-
$item = $this->cache->getItem('key');
151+
$item = $this->cache->getItem('key')->set('value');
152152
$item->setTags(['tag1']);
153153
$this->cache->save($item);
154154

155155
$this->cache->clear();
156156

157157
// Create a new item (no tags)
158-
$item = $this->cache->getItem('key');
158+
$item = $this->cache->getItem('key')->set('value');
159159
$this->cache->save($item);
160160
$this->cache->clearTags(['tag1']);
161161

@@ -170,14 +170,14 @@ public function testClearTag()
170170
return;
171171
}
172172

173-
$item = $this->cache->getItem('key');
173+
$item = $this->cache->getItem('key')->set('value');
174174
$item->setTags(['tag1']);
175175
$this->cache->save($item);
176176

177177
$this->cache->clearTags(['tag1']);
178178

179179
// Create a new item (no tags)
180-
$item = $this->cache->getItem('key');
180+
$item = $this->cache->getItem('key')->set('value');
181181
$this->cache->save($item);
182182
$this->cache->clearTags(['tag1']);
183183

0 commit comments

Comments
 (0)