protected function CacheTestBase::checkCacheExists

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

2 calls to CacheTestBase::checkCacheExists()
CacheTestBase::assertCacheExists in drupal/core/modules/system/lib/Drupal/system/Tests/Cache/CacheTestBase.php
Asserts that a cache entry exists.
ClearTest::testFlushAllCaches in drupal/core/modules/system/lib/Drupal/system/Tests/Cache/ClearTest.php
Tests drupal_flush_all_caches().

File

drupal/core/modules/system/lib/Drupal/system/Tests/Cache/CacheTestBase.php, line 33
Definition of Drupal\system\Tests\Cache\CacheTestBase.

Class

CacheTestBase
Provides helper methods for cache tests.

Namespace

Drupal\system\Tests\Cache

Code

protected function checkCacheExists($cid, $var, $bin = NULL) {
  if ($bin == NULL) {
    $bin = $this->default_bin;
  }
  $cached = cache($bin)
    ->get($cid);
  return isset($cached->data) && $cached->data == $var;
}