You are here

protected function CacheTestCase::checkCacheExists in SimpleTest 7

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.

5 calls to CacheTestCase::checkCacheExists()
CacheClearCase::testClearArray in tests/cache.test
Test clearing using an array.
CacheClearCase::testClearCid in tests/cache.test
Test clearing using a cid.
CacheClearCase::testClearWildcard in tests/cache.test
Test clearing using wildcard.
CacheGetMultipleUnitTest::testCacheMultiple in tests/cache.test
Test cache_get_multiple().
CacheTestCase::assertCacheExists in tests/cache.test
Assert or a cache entry exists.

File

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