You are here

protected function ApcCacheTestCase::checkCacheExists in APC - Alternative PHP Cache 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.

6 calls to ApcCacheTestCase::checkCacheExists()
ApcCacheClearCase::testClearArray in tests/apc.test
Test clearing using an array.
ApcCacheClearCase::testClearCid in tests/apc.test
Test clearing using a cid.
ApcCacheClearCase::testClearWildcard in tests/apc.test
Test clearing using wildcard.
ApcCacheClearCase::testFlushAllCaches in tests/apc.test
Test drupal_flush_all_caches().
ApcCacheGetMultipleUnitTest::testCacheMultiple in tests/apc.test
Test cache_get_multiple().

... See full list

File

tests/apc.test, line 26

Class

ApcCacheTestCase

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