/** * Test getting the ttl for a key in milliseconds */ public function testPttl() { $this->redis->del('testPttl'); $pttl = $this->redis->pttl('testPttl'); $this->assertInternalType('int', $pttl); $this->assertLessThan(0, $pttl); $this->redis->set('testPttl', 'someValue'); $this->assertLessThan(0, $this->redis->pttl('testPttl')); $this->redis->expire('testPttl', 1); $this->assertGreaterThan(5, $this->redis->pttl('testPttl')); // Using 5 here just ensures that the ttl is not returned in seconds (which could be 1 maximum) }