Example #1
0
 public function testTouch()
 {
     $this->rediska->set('test', array('aaa', time(), 100));
     $this->rediska->expire('test', 100);
     $reply = $this->cache->touch('test', 200);
     $this->assertTrue($reply);
     $lifetime = $this->rediska->getLifetime('test');
     $this->assertTrue($lifetime > 290);
     $values = $this->rediska->get('test');
     $this->assertEquals(300, $values[2]);
 }
Example #2
0
 /**
  * @group touch
  */
 public function testTouch()
 {
     $this->cache->save('aaa', 'test_id', array(), 100);
     $reply = $this->cache->touch('test_id', 200);
     $this->assertTrue($reply);
     $meta = $this->cache->getMetadatas('test_id');
     $lifetime = $meta['expire'] - time();
     $this->assertTrue($lifetime >= 299);
     $this->assertTrue($lifetime <= 301);
 }