You are here

public function CacheTest::testDeleteAllNamespace in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php \Doctrine\Tests\Common\Cache\CacheTest::testDeleteAllNamespace()

File

vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php, line 226

Class

CacheTest

Namespace

Doctrine\Tests\Common\Cache

Code

public function testDeleteAllNamespace() {
  $cache = $this
    ->_getCacheDriver();
  $cache
    ->setNamespace('ns1');
  $this
    ->assertFalse($cache
    ->contains('key1'));
  $cache
    ->save('key1', 'test');
  $this
    ->assertTrue($cache
    ->contains('key1'));
  $cache
    ->setNamespace('ns2');
  $this
    ->assertFalse($cache
    ->contains('key1'));
  $cache
    ->save('key1', 'test');
  $this
    ->assertTrue($cache
    ->contains('key1'));
  $cache
    ->setNamespace('ns1');
  $this
    ->assertTrue($cache
    ->contains('key1'));
  $cache
    ->deleteAll();
  $this
    ->assertFalse($cache
    ->contains('key1'));
  $cache
    ->setNamespace('ns2');
  $this
    ->assertTrue($cache
    ->contains('key1'));
  $cache
    ->deleteAll();
  $this
    ->assertFalse($cache
    ->contains('key1'));
}