diff options
author | Nicolas Favre-Felix <n.favrefelix@gmail.com> | 2010-10-27 16:22:19 +0400 |
---|---|---|
committer | Nicolas Favre-Felix <n.favrefelix@gmail.com> | 2010-10-27 16:22:19 +0400 |
commit | 85e4746be9dda9e2332751141e10db7361dc5466 (patch) | |
tree | 5bd83969817e702a2c41203a550b9d512e9dbc45 | |
parent | d6e58b0ea3f60aca0d072453a1f7fe6331ce08cd (diff) |
Added unit tests for INCRBY, DECRBY.
-rw-r--r-- | tests/TestRedis.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/TestRedis.php b/tests/TestRedis.php index 59a61b86..8fc2d04a 100644 --- a/tests/TestRedis.php +++ b/tests/TestRedis.php @@ -293,8 +293,11 @@ class Redis_Test extends PHPUnit_Framework_TestCase $this->redis->incrBy('key', 3); $this->assertEquals(8, $this->redis->get('key')); + $this->redis->incrBy('key', 1); + $this->assertEquals(9, $this->redis->get('key')); + $this->redis->incrBy('key', -1); - $this->assertEquals(7, $this->redis->get('key')); + $this->assertEquals(8, $this->redis->get('key')); $this->redis->delete('key'); @@ -324,8 +327,14 @@ class Redis_Test extends PHPUnit_Framework_TestCase $this->redis->decr('key', 2); $this->assertEquals(-1, $this->redis->get('key')); + $this->redis->decrBy('key', 2); + $this->assertEquals(-3, $this->redis->get('key')); + + $this->redis->decrBy('key', 1); + $this->assertEquals(-4, $this->redis->get('key')); + $this->redis->decr('key', -10); - $this->assertEquals(9, $this->redis->get('key')); + $this->assertEquals(6, $this->redis->get('key')); } public function testExists() |