protected function CacheTestCase::checkCacheExists

7.x 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.

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

... See full list

File

drupal-7.x/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;
}