mirror of
https://github.com/predis/predis.git
synced 2026-08-30 04:02:22 +00:00
[tests] Improve tests of TTL.
This commit is contained in:
@@ -85,13 +85,15 @@ class KeyTimeToLiveTest extends CommandTestCase
|
||||
|
||||
/**
|
||||
* @group connected
|
||||
* @todo TTL 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 testReturnsLessThanZeroOnNonExistingKeys()
|
||||
{
|
||||
$redis = $this->getClient();
|
||||
$this->executeOnRedisVersion('2.8.0', '<', function ($test) {
|
||||
$test->assertSame(-1, $test->getClient()->ttl('foo'));
|
||||
});
|
||||
|
||||
$this->assertLessThanOrEqual(-1, $redis->ttl('foo'));
|
||||
$this->executeOnRedisVersion('2.8.0', '>=', function ($test) {
|
||||
$test->assertSame(-2, $test->getClient()->ttl('foo'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user