public function CacheTest::testFlushAllAndNamespaceVersioningBetweenCaches in Plug 7
File
- lib/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php, line 156
Class
- CacheTest
Namespace
Doctrine\Tests\Common\Cache
Code
public function testFlushAllAndNamespaceVersioningBetweenCaches() {
if (!$this
->isSharedStorage()) {
$this
->markTestSkipped('The ' . __CLASS__ . ' does not use shared storage');
}
$cache1 = $this
->_getCacheDriver();
$cache2 = $this
->_getCacheDriver();
$cache1
->deleteAll();
$this
->assertTrue($cache1
->save('key1', 1));
$this
->assertTrue($cache2
->save('key2', 2));
$this
->assertTrue($cache1
->contains('key1'));
$this
->assertTrue($cache1
->contains('key2'));
$this
->assertTrue($cache2
->contains('key1'));
$this
->assertTrue($cache2
->contains('key2'));
$this
->assertTrue($cache1
->flushAll());
$this
->assertFalse($cache1
->contains('key1'));
$this
->assertFalse($cache1
->contains('key2'));
$this
->assertFalse($cache2
->contains('key1'));
$this
->assertFalse($cache2
->contains('key2'));
$this
->assertTrue($cache1
->save('key1', 1));
$this
->assertTrue($cache1
->contains('key1'));
$this
->assertTrue($cache2
->contains('key1'));
$cache3 = $this
->_getCacheDriver();
$this
->assertFalse($cache3
->contains('key1'));
$this
->assertFalse($cache3
->contains('key2'));
$this
->assertTrue($cache3
->save('key3', 3));
$this
->assertTrue($cache3
->contains('key3'));
}