function CacheTestBase::assertCacheRemoved
Same name in this branch
- 8.9.x core/modules/system/tests/src/Functional/Cache/CacheTestBase.php \Drupal\Tests\system\Functional\Cache\CacheTestBase::assertCacheRemoved()
Same name in other branches
- 9 core/modules/system/tests/src/Functional/Cache/CacheTestBase.php \Drupal\Tests\system\Functional\Cache\CacheTestBase::assertCacheRemoved()
- 10 core/modules/system/tests/src/Functional/Cache/CacheTestBase.php \Drupal\Tests\system\Functional\Cache\CacheTestBase::assertCacheRemoved()
- 11.x core/modules/system/tests/src/Functional/Cache/CacheTestBase.php \Drupal\Tests\system\Functional\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 82
Class
- CacheTestBase
- Provides helper methods for cache tests.
Namespace
Drupal\system\Tests\CacheCode
public 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);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.