Skip to content

Commit

Permalink
Added test for deleting kwys under a group in MemcacheEngine
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Mar 26, 2012
1 parent 411bd85 commit d0f7842
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/Cake/Test/Case/Cache/Engine/MemcacheEngineTest.php
Expand Up @@ -433,4 +433,22 @@ public function testGroupReadWrite() {
$this->assertTrue(Cache::write('test_groups', 'value3', 'memcache_groups'));
$this->assertEquals('value3', Cache::read('test_groups', 'memcache_groups'));
}

/**
* Tests that deleteing from a groups-enabled config is possible
*
* @return void
*/
public function testGroupDelete() {
Cache::config('memcache_groups', array(
'engine' => 'Memcache',
'duration' => 3600,
'groups' => array('group_a', 'group_b')
));
$this->assertTrue(Cache::write('test_groups', 'value', 'memcache_groups'));
$this->assertEquals('value', Cache::read('test_groups', 'memcache_groups'));
$this->assertTrue(Cache::delete('test_groups', 'memcache_groups'));

$this->assertFalse(Cache::read('test_groups', 'memcache_groups'));
}
}

0 comments on commit d0f7842

Please sign in to comment.