mirror of
https://github.com/predis/predis.git
synced 2026-08-24 15:39:28 +00:00
Do not parse response to EXISTS into boolean value.
Starting with Redis 3.0.3 the EXISTS command is variadic so that it is
possible to check for the existence of multiple keys in one request,
with the server returning the number of keys found.
This change could break codebases relying on strict comparison (===)
against a boolean value, but just doing $redis->exists('key') == TRUE
is totally fine.
This commit is contained in:
@@ -63,7 +63,7 @@ class StringPreciseSetExpireTest extends PredisCommandTestCase
|
||||
$redis = $this->getClient();
|
||||
|
||||
$this->assertEquals('OK', $redis->psetex('foo', 10000, 'bar'));
|
||||
$this->assertTrue($redis->exists('foo'));
|
||||
$this->assertSame(1, $redis->exists('foo'));
|
||||
$this->assertEquals(10, $redis->ttl('foo'));
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ class StringPreciseSetExpireTest extends PredisCommandTestCase
|
||||
|
||||
$redis->psetex('foo', 50, 'bar');
|
||||
$this->sleep(0.5);
|
||||
$this->assertFalse($redis->exists('foo'));;
|
||||
$this->assertSame(0, $redis->exists('foo'));;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user