public function MemCacheClearCase::clearCidTest in Memcache API and Integration 7
Same name in this branch
- 7 tests/memcache.test \MemCacheClearCase::clearCidTest()
- 7 tests/memcache6.test \MemCacheClearCase::clearCidTest()
Same name and namespace in other branches
- 6 tests/memcache.test \MemCacheClearCase::clearCidTest()
Test clearing using a cid.
4 calls to MemCacheClearCase::clearCidTest()
- MemCacheClearCase::testClearCidLifetime in tests/
memcache.test - Test clearing the cache with a cid, with cache lifetime.
- MemCacheClearCase::testClearCidLifetime in tests/
memcache6.test - Test clearing the cache with a cid, with cache lifetime.
- MemCacheClearCase::testClearCidNoLifetime in tests/
memcache.test - Test clearing the cache with a cid, no cache lifetime.
- MemCacheClearCase::testClearCidNoLifetime in tests/
memcache6.test - Test clearing the cache with a cid, no cache lifetime.
File
- tests/
memcache.test, line 610 - Test cases for the memcache cache backend.
Class
- MemCacheClearCase
- Test cache clearing methods.
Code
public function clearCidTest() {
cache_set('test_cid_clear', $this->default_value, $this->default_bin);
$this
->assertCacheExists(t('Cache was set for clearing cid.'), $this->default_value, 'test_cid_clear');
cache_clear_all('test_cid_clear', $this->default_bin);
$this
->assertCacheRemoved(t('Cache was removed after clearing cid.'), 'test_cid_clear');
cache_set('test_cid_clear1', $this->default_value, $this->default_bin);
cache_set('test_cid_clear2', $this->default_value, $this->default_bin);
$this
->assertTrue($this
->checkCacheExists('test_cid_clear1', $this->default_value) && $this
->checkCacheExists('test_cid_clear2', $this->default_value), t('Two caches were created for checking cid "*" with wildcard false.'));
cache_clear_all('*', $this->default_bin);
$this
->assertTrue($this
->checkCacheExists('test_cid_clear1', $this->default_value) && $this
->checkCacheExists('test_cid_clear2', $this->default_value), t('Two caches still exists after clearing cid "*" with wildcard false.'));
}