Преглед на файлове

Do not parse response to HSET into boolean value.

Daniele Alessandri преди 9 години
родител
ревизия
ae26ecc8bf
променени са 2 файла, в които са добавени 4 реда и са изтрити 12 реда
  1. 0 8
      src/Command/HashSet.php
  2. 4 4
      tests/Predis/Command/HashSetTest.php

+ 0 - 8
src/Command/HashSet.php

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

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

@@ -54,8 +54,8 @@ class HashSetTest 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));
     }
 
     /**
@@ -65,8 +65,8 @@ class HashSetTest extends PredisCommandTestCase
     {
         $redis = $this->getClient();
 
-        $this->assertTrue($redis->hset('metavars', 'foo', 'bar'));
-        $this->assertTrue($redis->hset('metavars', 'hoge', 'piyo'));
+        $this->assertSame(1, $redis->hset('metavars', 'foo', 'bar'));
+        $this->assertSame(1, $redis->hset('metavars', 'hoge', 'piyo'));
 
         $this->assertSame(array('bar', 'piyo'), $redis->hmget('metavars', 'foo', 'hoge'));
     }