|
@@ -89,21 +89,23 @@ class KeyPreciseTimeToLiveTest extends CommandTestCase
|
|
|
/**
|
|
|
* @group connected
|
|
|
*/
|
|
|
- public function testReturnsLessThanZeroOnNonExistingKeys()
|
|
|
+ public function testReturnsLessThanZeroOnNonExpiringKeys()
|
|
|
{
|
|
|
$redis = $this->getClient();
|
|
|
|
|
|
+ $redis->set('foo', 'bar');
|
|
|
$this->assertSame(-1, $redis->pttl('foo'));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @group connected
|
|
|
+ * @todo PTTL changed in Redis >= 2.8 to return -2 on non existing keys, we
|
|
|
+ * should handle this case with a better solution than the current one.
|
|
|
*/
|
|
|
- public function testReturnsLessThanZeroOnNonExpiringKeys()
|
|
|
+ public function testReturnsLessThanZeroOnNonExistingKeys()
|
|
|
{
|
|
|
$redis = $this->getClient();
|
|
|
|
|
|
- $redis->set('foo', 'bar');
|
|
|
- $this->assertSame(-1, $redis->pttl('foo'));
|
|
|
+ $this->assertLessThanOrEqual(-1, $redis->pttl('foo'));
|
|
|
}
|
|
|
}
|