function MemCacheClearCase::clearCidTest in Zircon Profile 8.0
Same name in this branch
- 8.0 modules/memcache/tests/memcache.test \MemCacheClearCase::clearCidTest()
- 8.0 modules/memcache/tests/memcache6.test \MemCacheClearCase::clearCidTest()
Same name and namespace in other branches
- 8 modules/memcache/tests/memcache.test \MemCacheClearCase::clearCidTest()
- 8 modules/memcache/tests/memcache6.test \MemCacheClearCase::clearCidTest()
Test clearing using a cid.
4 calls to MemCacheClearCase::clearCidTest()
- MemCacheClearCase::testClearCidLifetime in modules/
memcache/ tests/ memcache.test - Test clearing the cache with a cid, with cache lifetime.
- MemCacheClearCase::testClearCidLifetime in modules/
memcache/ tests/ memcache6.test - Test clearing the cache with a cid, with cache lifetime.
- MemCacheClearCase::testClearCidNoLifetime in modules/
memcache/ tests/ memcache.test - Test clearing the cache with a cid, no cache lifetime.
- MemCacheClearCase::testClearCidNoLifetime in modules/
memcache/ tests/ memcache6.test - Test clearing the cache with a cid, no cache lifetime.
File
- modules/
memcache/ tests/ memcache6.test, line 296
Class
- MemCacheClearCase
- Test cache clearing methods.
Code
function clearCidTest() {
variable_set("cache_flush_{$this->default_bin}", 0);
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.'));
}