Esempio n. 1
0
 protected function getPool()
 {
     try {
         $pool = \Hoard\CacheManager::getPool('test.simple');
         $pool->clear();
         return $pool;
     } catch (\Exception $e) {
         if ($e->getMessage() == 'Memcached extension is not installed.') {
             $this->markTestSkipped();
         }
         throw $e;
     }
 }
Esempio n. 2
0
 public function setUp()
 {
     parent::setUp();
     // get pools
     $this->parentPool = \Hoard\CacheManager::getPool('test.memcached');
     $this->childPool = \Hoard\CacheManager::getPool('test.memcached.child_pool');
     try {
         // test for extension
         $this->parentPool->getItem('doesnt_exist');
     } catch (\Exception $e) {
         if ($e->getMessage() == 'Memcached extension is not installed.') {
             $this->markTestSkipped();
         }
         throw $e;
     }
     // rather than getting blank pools, we want to ensure existing data
     // stays in there and we use non-colliding keys
     $this->key = md5(rand() . time());
 }
Esempio n. 3
0
 protected function getPool()
 {
     $pool = \Hoard\CacheManager::getPool('test.redis');
     $pool->clear();
     return $pool;
 }