Skip to content

Commit 622709f

Browse files
Added a test for 'raw' commands
1 parent 1cb7099 commit 622709f

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

tests/RedisClusterTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,5 +484,15 @@ public function testFailOver() {
484484
break;
485485
}
486486
}
487+
488+
/* Test a 'raw' command */
489+
public function testRawCommand() {
490+
$this->redis->rawCommand('mykey', 'set', 'mykey', 'my-value');
491+
$this->assertEquals($this->redis->get('mykey'), 'my-value');
492+
493+
$this->redis->del('mylist');
494+
$this->redis->rpush('mylist', 'A','B','C','D');
495+
$this->assertEquals($this->redis->lrange('mylist', 0, -1), Array('A','B','C','D'));
496+
}
487497
}
488498
?>

tests/RedisTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4755,5 +4755,16 @@ public function testPFCommands() {
47554755
}
47564756
}
47574757
}
4758+
4759+
/* Test a 'raw' command */
4760+
public function testRawCommand() {
4761+
$this->redis->set('mykey','some-value');
4762+
$str_result = $this->redis->rawCommand('get', 'mykey');
4763+
$this->assertEquals($str_result, 'some-value');
4764+
4765+
$this->redis->del('mylist');
4766+
$this->redis->rpush('mylist', 'A', 'B', 'C', 'D');
4767+
$this->assertEquals($this->redis->lrange('mylist', 0, -1), Array('A','B','C','D'));
4768+
}
47584769
}
47594770
?>

0 commit comments

Comments
 (0)