You are here

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

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

2 calls to MemcacheTestCase::checkCacheExists()
MemcacheTestCase::assertCacheExists in tests/memcache.test
Assert or a cache entry exists.
MemcacheTestCase::assertCacheExists in tests/memcache6.test
Assert or a cache entry exists.

File

tests/memcache6.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;
}