protected function CacheTestCase::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.

6 calls to CacheTestCase::checkCacheExists()
CacheClearCase::testClearArray in drupal/modules/simpletest/tests/cache.test
Test clearing using an array.
CacheClearCase::testClearCid in drupal/modules/simpletest/tests/cache.test
Test clearing using a cid.
CacheClearCase::testClearWildcard in drupal/modules/simpletest/tests/cache.test
Test clearing using wildcard.
CacheClearCase::testFlushAllCaches in drupal/modules/simpletest/tests/cache.test
Test drupal_flush_all_caches().
CacheGetMultipleUnitTest::testCacheMultiple in drupal/modules/simpletest/tests/cache.test
Test cache_get_multiple().

... See full list

File

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

Class

CacheTestCase

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