public function testGetLifetime() { $this->key->getRediska()->set($this->key->getName(), 1); $this->key->getRediska()->expire($this->key->getName(), 50); $reply = $this->key->getLifetime(); $this->assertGreaterThan(45, $reply); }
public function testDecrement() { $this->key->getRediska()->set($this->key->getName(), 123); $reply = $this->key->decrement(2); $this->assertEquals(121, $reply); $reply = $this->key->getRediska()->get($this->key->getName()); $this->assertEquals(121, $reply); }
public function testAppend() { $this->key->setValue('abc'); $reply = $this->key->append('abc'); $this->assertEquals(6, $reply); $reply = $this->key->getRediska()->get($this->key->getName()); $this->assertEquals('abcabc', $reply); }
public function testSetExpireTimestamp() { $time = time() + 1; $this->key->setExpire($time, true); $expire = $this->key->getExpire(); $this->assertEquals($time, $expire); $this->assertTrue($this->key->isExpireTimestamp()); $this->key->setValue(1); sleep(2); $reply = $this->key->getRediska()->get($this->key->getName()); $this->assertNull($reply); }