CacheTestCase::checkCacheExists

7 cache.test protected CacheTestCase::checkCacheExists($cid, $var, $bin = NULL)
8 cache.test protected CacheTestCase::checkCacheExists($cid, $var, $bin = NULL)

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.

File

modules/simpletest/tests/cache.test, line 20

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;
}
Login or register to post comments