Explorar o código

Fixed the tests for RPOPLPUSH as they were still using the old alias even after the command has been renamed from LPOPPUSH

Daniele Alessandri %!s(int64=15) %!d(string=hai) anos
pai
achega
7f4072054a
Modificáronse 1 ficheiros con 19 adicións e 18 borrados
  1. 19 18
      test/RedisCommandsTest.php

+ 19 - 18
test/RedisCommandsTest.php

@@ -458,24 +458,6 @@ class RedisCommandTestSuite extends PHPUnit_Framework_TestCase {
         });
         });
     }
     }
 
 
-    function testListPopPush() {
-        $numbers = RC::pushTailAndReturn($this->redis, 'numbers', array(0, 1, 2));
-
-        $this->assertEquals(0, $this->redis->listLength('temporary'));
-        $this->assertEquals(2, $this->redis->listPopPush('numbers', 'temporary'));
-        $this->assertEquals(1, $this->redis->listPopPush('numbers', 'temporary'));
-        $this->assertEquals(0, $this->redis->listPopPush('numbers', 'temporary'));
-        $this->assertEquals(0, $this->redis->listLength('numbers'));
-        $this->assertEquals(3, $this->redis->listLength('temporary'));
-        $this->assertEquals(array(), $this->redis->listRange('numbers', 0, -1));
-        $this->assertEquals($numbers, $this->redis->listRange('temporary', 0, -1));
-
-        RC::testForServerException($this, RC::EXCEPTION_WRONG_TYPE, function($test) {
-            $test->redis->set('foo', 'bar');
-            $test->redis->listPopPush('foo', 'hoge');
-        });
-    }
-
     function testListPopFirst() {
     function testListPopFirst() {
         $numbers = RC::pushTailAndReturn($this->redis, 'numbers', array(0, 1, 2, 3, 4));
         $numbers = RC::pushTailAndReturn($this->redis, 'numbers', array(0, 1, 2, 3, 4));
 
 
@@ -523,6 +505,25 @@ class RedisCommandTestSuite extends PHPUnit_Framework_TestCase {
     }
     }
 
 
 
 
+    function testListPushTailPopFist() {
+        $numbers = RC::pushTailAndReturn($this->redis, 'numbers', array(0, 1, 2));
+
+        $this->assertEquals(0, $this->redis->listLength('temporary'));
+        $this->assertEquals(2, $this->redis->listPushTailPopFist('numbers', 'temporary'));
+        $this->assertEquals(1, $this->redis->listPushTailPopFist('numbers', 'temporary'));
+        $this->assertEquals(0, $this->redis->listPushTailPopFist('numbers', 'temporary'));
+        $this->assertEquals(0, $this->redis->listLength('numbers'));
+        $this->assertEquals(3, $this->redis->listLength('temporary'));
+        $this->assertEquals(array(), $this->redis->listRange('numbers', 0, -1));
+        $this->assertEquals($numbers, $this->redis->listRange('temporary', 0, -1));
+
+        RC::testForServerException($this, RC::EXCEPTION_WRONG_TYPE, function($test) {
+            $test->redis->set('foo', 'bar');
+            $test->redis->listPushTailPopFist('foo', 'hoge');
+        });
+    }
+
+
     /* commands operating on sets */
     /* commands operating on sets */
 
 
     function testSetAdd() {
     function testSetAdd() {