protected function MemcacheTestCase::checkCacheExists in Memcache API and Integration 6
Same name and namespace in other branches
- 7 tests/memcache.test \MemcacheTestCase::checkCacheExists()
- 7 tests/memcache6.test \MemcacheTestCase::checkCacheExists()
Check whether or not a cache entry exists.
Parameters
$cid: The cache id.
$var: The variable the cache should contain.
$bin: The bin the cache item was stored in.
Return value
TRUE on pass, FALSE on fail.
5 calls to MemcacheTestCase::checkCacheExists()
- MemCacheClearCase::clearCidTest in tests/
memcache.test - Test clearing using a cid.
- MemCacheClearCase::clearWildcardPrefixTest in tests/
memcache.test - Test cache clears using wildcard prefixes.
- MemCacheClearCase::testClearCacheLifetime in tests/
memcache.test - Test full bin flushes with cache lifetime.
- MemCacheClearCase::testClearWildcardFull in tests/
memcache.test - Test full bin flushes with no cache lifetime.
- MemcacheTestCase::assertCacheExists in tests/
memcache.test - Assert or a cache entry exists.
File
- tests/
memcache.test, line 24
Class
Code
protected function checkCacheExists($cid, $var, $bin = NULL) {
if ($bin == NULL) {
$bin = $this->default_bin;
}
$cache = cache_get($cid, $bin);
return isset($cache->data) && $cache->data == $var;
}