Ejemplo n.º 1
0
 /**
  * Test pushing an array of elements from the left and popping them from the right
  */
 public function testRpushx()
 {
     $this->redis->del('testRpushx');
     $pushResult = $this->redis->rpushx('testRpushx', 'someValue');
     $this->assertInternalType('int', $pushResult);
     $this->assertEquals(0, $pushResult);
     $this->assertEquals(0, $this->redis->rpushx('testRpushx', 'someValue'));
     $this->redis->rpush('testRpushx', 'someValue');
     $this->assertEquals(2, $this->redis->rpushx('testRpushx', 'someValue'));
     $this->assertEquals('someValue', $this->redis->lpop('testRpushx'));
     $this->assertEquals('someValue', $this->redis->lpop('testRpushx'));
     $this->assertEquals(0, $this->redis->llen('testRpushx'));
 }