Quellcode durchsuchen

Do not parse response to SMOVE into boolean value.

Daniele Alessandri vor 9 Jahren
Ursprung
Commit
5ce683be09
2 geänderte Dateien mit 4 neuen und 12 gelöschten Zeilen
  1. 0 8
      src/Command/SetMove.php
  2. 4 4
      tests/Predis/Command/SetMoveTest.php

+ 0 - 8
src/Command/SetMove.php

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

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

@@ -54,8 +54,8 @@ class SetMoveTest extends PredisCommandTestCase
     {
         $command = $this->getCommand();
 
-        $this->assertTrue($command->parseResponse(1));
-        $this->assertFalse($command->parseResponse(0));
+        $this->assertSame(0, $command->parseResponse(0));
+        $this->assertSame(1, $command->parseResponse(1));
     }
 
     /**
@@ -67,8 +67,8 @@ class SetMoveTest extends PredisCommandTestCase
 
         $redis->sadd('letters:source', 'a', 'b', 'c');
 
-        $this->assertTrue($redis->smove('letters:source', 'letters:destination', 'b'));
-        $this->assertFalse($redis->smove('letters:source', 'letters:destination', 'z'));
+        $this->assertSame(1, $redis->smove('letters:source', 'letters:destination', 'b'));
+        $this->assertSame(0, $redis->smove('letters:source', 'letters:destination', 'z'));
 
         $this->assertSameValues(array('a', 'c'), $redis->smembers('letters:source'));
         $this->assertSameValues(array('b'), $redis->smembers('letters:destination'));