Skip to content

Commit

Permalink
Added a test for 'raw' commands
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-grunder committed May 8, 2015
1 parent 1cb7099 commit 622709f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/RedisClusterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,5 +484,15 @@ public function testFailOver() {
break;
}
}

/* Test a 'raw' command */
public function testRawCommand() {
$this->redis->rawCommand('mykey', 'set', 'mykey', 'my-value');
$this->assertEquals($this->redis->get('mykey'), 'my-value');

$this->redis->del('mylist');
$this->redis->rpush('mylist', 'A','B','C','D');
$this->assertEquals($this->redis->lrange('mylist', 0, -1), Array('A','B','C','D'));
}
}
?>
11 changes: 11 additions & 0 deletions tests/RedisTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4755,5 +4755,16 @@ public function testPFCommands() {
}
}
}

/* Test a 'raw' command */
public function testRawCommand() {
$this->redis->set('mykey','some-value');
$str_result = $this->redis->rawCommand('get', 'mykey');
$this->assertEquals($str_result, 'some-value');

$this->redis->del('mylist');
$this->redis->rpush('mylist', 'A', 'B', 'C', 'D');
$this->assertEquals($this->redis->lrange('mylist', 0, -1), Array('A','B','C','D'));
}
}
?>

0 comments on commit 622709f

Please sign in to comment.