You are here

function CacheTestBase::assertCacheRemoved in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Cache/CacheTestBase.php \Drupal\system\Tests\Cache\CacheTestBase::assertCacheRemoved()

Asserts that a cache entry has been removed.

Parameters

$message: Message to display.

$cid: The cache id.

$bin: The bin the cache item was stored in.

File

core/modules/system/src/Tests/Cache/CacheTestBase.php, line 79
Contains \Drupal\system\Tests\Cache\CacheTestBase.

Class

CacheTestBase
Provides helper methods for cache tests.

Namespace

Drupal\system\Tests\Cache

Code

function assertCacheRemoved($message, $cid = NULL, $bin = NULL) {
  if ($bin == NULL) {
    $bin = $this->defaultBin;
  }
  if ($cid == NULL) {
    $cid = $this->defaultCid;
  }
  $cached = \Drupal::cache($bin)
    ->get($cid);
  $this
    ->assertFalse($cached, $message);
}