You are here

public function CacheTest::testDeleteAllNamespace in Plug 7

File

lib/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php, line 224

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'));
}