Added missing test for SORT ... GET

This commit is contained in:
Daniele Alessandri
2010-02-25 11:24:50 +01:00
parent 6e3b1c835d
commit 2c7a99df55
+15
View File
@@ -1285,6 +1285,21 @@ class RedisCommandTestSuite extends PHPUnit_Framework_TestCase {
);
$this->assertEquals(array(1, 2, 3, 10, 30, 100), $this->redis->listRange('ordered', 0, -1));
// with parameter GET
$this->redis->pushTail('uids', 1003);
$this->redis->pushTail('uids', 1001);
$this->redis->pushTail('uids', 1002);
$this->redis->pushTail('uids', 1000);
$sortget = array(
'uid:1000' => 'foo', 'uid:1001' => 'bar',
'uid:1002' => 'hoge', 'uid:1003' => 'piyo'
);
$this->redis->setMultiple($sortget);
$this->assertEquals(
array_values($sortget),
$this->redis->sort('uids', array('get' => 'uid:*'))
);
// wront type
RC::testForServerException($this, RC::EXCEPTION_WRONG_TYPE, function($test) {
$test->redis->set('foo', 'bar');