Skip to content

Commit

Permalink
Merge pull request #45 from Nyholm/tagging
Browse files Browse the repository at this point in the history
Update the tagging integration tests to support the new API
  • Loading branch information
Nyholm committed Feb 19, 2016
2 parents 4a046c4 + 4c107d9 commit f06618d
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 255 deletions.
45 changes: 0 additions & 45 deletions src/HierarchicalCachePoolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,6 @@ public function testBasicUsage()
$this->assertFalse($this->cache->hasItem('|users|4711|followers|4|likes'));
}

public function testBasicUsageWithTags()
{
if (isset($this->skippedTests[__FUNCTION__])) {
$this->markTestSkipped($this->skippedTests[__FUNCTION__]);

return;
}

$user = 4711;
for ($i = 0; $i < 10; $i++) {
$item = $this->cache->getItem(sprintf('|users|%d|followers|%d|likes', $user, $i), ['user']);
$item->set('Justin Bieber');
$this->cache->save($item);
}

$this->assertTrue($this->cache->hasItem('|users|4711|followers|4|likes', ['user']));
$this->cache->deleteItem('|users|4711|followers', ['user']);
$this->assertFalse($this->cache->hasItem('|users|4711|followers|4|likes', ['user']));
}

public function testChain()
{
if (isset($this->skippedTests[__FUNCTION__])) {
Expand Down Expand Up @@ -129,31 +109,6 @@ public function testChain()
$this->assertFalse($this->cache->hasItem('|aaa|bbb|zzz|ddd'));
}

public function testTagRemoval()
{
if (isset($this->skippedTests[__FUNCTION__])) {
$this->markTestSkipped($this->skippedTests[__FUNCTION__]);

return;
}

$item = $this->cache->getItem('|aaa|bbb', ['tag1']);
$item->set('value');
$this->cache->save($item);

$this->cache->deleteItem('|aaa|bbb', ['tag2']);
$this->assertTrue($this->cache->hasItem('|aaa|bbb', ['tag1']));

$this->cache->deleteItem('|aaa|bbb');
$this->assertTrue($this->cache->hasItem('|aaa|bbb', ['tag1']));

$this->cache->deleteItem('|aaa', ['tag2']);
$this->assertTrue($this->cache->hasItem('|aaa|bbb', ['tag1']));

$this->cache->deleteItem('|aaa');
$this->assertTrue($this->cache->hasItem('|aaa|bbb', ['tag1']));
}

public function testRemoval()
{
if (isset($this->skippedTests[__FUNCTION__])) {
Expand Down
Loading

0 comments on commit f06618d

Please sign in to comment.