You are here

protected function MemcacheTestCase::checkCacheExists in Memcache API and Integration 6

Same name and namespace in other branches
  1. 7 tests/memcache.test \MemcacheTestCase::checkCacheExists()
  2. 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

MemcacheTestCase

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;
}