Exemplo n.º 1
0
 public function testCacheRedisFlush()
 {
     $frontCache = new Phalcon\Cache\Frontend\Data(array('lifetime' => 10));
     $redis = $this->_prepareRedis();
     if (!$redis) {
         return false;
     }
     $frontCache = new Phalcon\Cache\Frontend\Data();
     $cache = new Phalcon\Cache\Backend\Redis($frontCache, array('host' => 'localhost', 'port' => 6379));
     $cache->save('data', "1");
     $cache->save('data2', "2");
     $this->assertTrue($cache->exists('data'));
     $this->assertTrue($cache->exists('data2'));
     $this->assertTrue($cache->flush());
     $this->assertFalse($cache->exists('data'));
     $this->assertFalse($cache->exists('data2'));
 }