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 modules/simpletest/tests/cache.test
Test clearing using an array.
CacheClearCase::testClearCid in modules/simpletest/tests/cache.test
Test clearing using a cid.
CacheClearCase::testClearWildcard in modules/simpletest/tests/cache.test
Test clearing using wildcard.
CacheClearCase::testFlushAllCaches in modules/simpletest/tests/cache.test
Test drupal_flush_all_caches().
CacheGetMultipleUnitTest::testCacheMultiple in modules/simpletest/tests/cache.test
Test cache_get_multiple().

... See full list

File

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.