/** * Compare the results of zrevrange using non-multi and multi mode */ public function testZRevRangeByScoreCompareMulti() { $memkey = "n_29,27,11,14,c/23336,106386,160879,341828"; $this->redis->zAdd($memkey, 123, 0.1); $this->redis->zAdd($memkey, 124, 0.2); // without pipeline $opts = array('withscores' => true); $resWithoutPipeline = $this->redis->zRevRangeByScore($memkey, '+inf', '-inf', $opts); // with multi $this->redis->multi(); $this->redis->zRevRangeByScore($memkey, '+inf', '-inf', $opts); $resWithMulti = $this->redis->exec(); // with pipeline $this->redis->pipeline(); $this->redis->zRevRangeByScore($memkey, '+inf', '-inf', $opts); $resWithPipeline = $this->redis->exec(); $this->assertEquals($resWithMulti[0], $resWithoutPipeline); $this->assertEquals($resWithMulti[0], $resWithPipeline[0]); $this->assertEquals($resWithPipeline[0], $resWithoutPipeline); }