1 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

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

Class

CacheTestCase

Code

protected function checkCacheExists($cid, $var, $bin = NULL) {
  if ($bin == NULL) {
    $bin = $this->default_bin;
  }

  $cached = cache($bin)->get($cid);

  return isset($cached->data) && $cached->data == $var;
}