You are here

public function BackendClearTests::testClearCid in Supercache 8

Same name and namespace in other branches
  1. 2.0.x src/Tests/Generic/Cache/BackendClearTests.php \Drupal\supercache\Tests\Generic\Cache\BackendClearTests::testClearCid()

Test clearing using a cid.

File

src/Tests/Generic/Cache/BackendClearTests.php, line 24

Class

BackendClearTests
Testea funciones basicas.

Namespace

Drupal\supercache\Tests\Generic\Cache

Code

public function testClearCid() {
  $this->backend
    ->set('test_cid_clear', $this->defaultvalue, CacheBackendInterface::CACHE_PERMANENT);
  $this
    ->assertExists('Cache was set for clearing cid.', $this->defaultvalue, 'test_cid_clear');
  $this->backend
    ->delete('test_cid_clear');
  $this
    ->assertRemoved('Item was removed after clearing cid.', 'test_cid_clear');
  $this->backend
    ->set('test_cid_clear1', $this->defaultvalue, CacheBackendInterface::CACHE_PERMANENT);
  $this->backend
    ->set('test_cid_clear2', $this->defaultvalue, CacheBackendInterface::CACHE_PERMANENT);
  $this
    ->assertTrue($this
    ->checkExists('test_cid_clear1', $this->defaultvalue) && $this
    ->checkExists('test_cid_clear2', $this->defaultvalue), 'Two caches were created for checking cid "*" with wildcard false.');
}