Exemple #1
0
 public function testCountStorages()
 {
     $stack = new ezcCacheStack('foo');
     $storageConf1 = new ezcCacheStackStorageConfiguration('id_1', new ezcCacheStorageFileArray($this->getTempSubDir()), 10, 0.5);
     $storageConf2 = new ezcCacheStackStorageConfiguration('id_2', new ezcCacheStorageFileArray($this->getTempSubDir()), 100, 0.9);
     $this->assertEquals(0, $stack->countStorages());
     $stack->pushStorage($storageConf1);
     $this->assertEquals(1, $stack->countStorages());
     $stack->pushStorage($storageConf2);
     $this->assertEquals(2, $stack->countStorages());
     $stack->popStorage();
     $this->assertEquals(1, $stack->countStorages());
     $stack->popStorage();
     $this->assertEquals(0, $stack->countStorages());
 }