Explorar o código

Do not parse response to RENAMENX into boolean value.

Daniele Alessandri %!s(int64=9) %!d(string=hai) anos
pai
achega
fda9f022dd

+ 0 - 8
src/Command/KeyRenamePreserve.php

@@ -24,12 +24,4 @@ class KeyRenamePreserve extends KeyRename
     {
         return 'RENAMENX';
     }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function parseResponse($data)
-    {
-        return (bool) $data;
-    }
 }

+ 4 - 4
tests/Predis/Command/KeyRenamePreserveTest.php

@@ -52,8 +52,8 @@ class KeyRenamePreserveTest extends PredisCommandTestCase
      */
     public function testParseResponse()
     {
-        $this->assertTrue($this->getCommand()->parseResponse(1));
-        $this->assertFalse($this->getCommand()->parseResponse(0));
+        $this->assertSame(0, $this->getCommand()->parseResponse(0));
+        $this->assertSame(1, $this->getCommand()->parseResponse(1));
     }
 
     /**
@@ -65,7 +65,7 @@ class KeyRenamePreserveTest extends PredisCommandTestCase
 
         $redis->set('foo', 'bar');
 
-        $this->assertTrue($redis->renamenx('foo', 'foofoo'));
+        $this->assertSame(1, $redis->renamenx('foo', 'foofoo'));
         $this->assertSame(0, $redis->exists('foo'));
         $this->assertSame(1, $redis->exists('foofoo'));
     }
@@ -79,6 +79,6 @@ class KeyRenamePreserveTest extends PredisCommandTestCase
     {
         $redis = $this->getClient();
 
-        $this->assertFalse($redis->renamenx('foo', 'foobar'));
+        $this->assertSame(0, $redis->renamenx('foo', 'foobar'));
     }
 }