浏览代码

Change the behavior of a test and add a reminder for a later in-depth examination of alternatives.

Daniele Alessandri 15 年之前
父节点
当前提交
40d5b04278
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 2 0
      lib/Predis.php
  2. 1 1
      test/PredisClientFeatures.php

+ 2 - 0
lib/Predis.php

@@ -363,6 +363,8 @@ abstract class Command {
         }
         else {
             if (isset($this->_arguments[0])) {
+                // TODO: should we throw an exception if the command does 
+                //       not support sharding?
                 $key = $this->_arguments[0];
 
                 $start = strpos($key, '{');

+ 1 - 1
test/PredisClientFeatures.php

@@ -129,7 +129,7 @@ class PredisClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
         $this->assertEquals('MSET', $cmd->getCommandId());
         $this->assertFalse($cmd->closesConnection());
         $this->assertFalse($cmd->canBeHashed());
-        $this->assertNull($cmd->getHash(new \Predis\Distribution\HashRing()));
+        $this->assertNotNull($cmd->getHash(new \Predis\Distribution\HashRing()));
         $this->assertEquals("*5\r\n$4\r\nMSET\r\n$4\r\nkey1\r\n$6\r\nvalue1\r\n$4\r\nkey2\r\n$6\r\nvalue2\r\n", $cmd());
     }