mirror of
https://github.com/predis/predis.git
synced 2026-10-11 22:36:53 +00:00
Trying to increment a string value associated to an hash now raises an error.
This commit is contained in:
@@ -1546,8 +1546,10 @@ class RedisCommandTestSuite extends PHPUnit_Framework_TestCase {
|
||||
$this->assertEquals(20, $this->redis->hincrby('hash', 'counter', 10));
|
||||
$this->assertEquals(0, $this->redis->hincrby('hash', 'counter', -20));
|
||||
|
||||
$this->assertTrue($this->redis->hset('hash', 'field', 'stringvalue'));
|
||||
$this->assertEquals(10, $this->redis->hincrby('hash', 'field', 10));
|
||||
RC::testForServerException($this, RC::EXCEPTION_HASH_VALNOTINT, function($test) {
|
||||
$test->redis->hset('hash', 'field', 'stringvalue');
|
||||
$test->redis->hincrby('hash', 'field', 10);
|
||||
});
|
||||
|
||||
RC::testForServerException($this, RC::EXCEPTION_WRONG_TYPE, function($test) {
|
||||
$test->redis->set('foo', 'bar');
|
||||
|
||||
Reference in New Issue
Block a user