소스 검색

Fix handling of scripted commands with redis-cluster hash strategy.

A missing "use" directive was preventing the hash strategy to properly
use the specific methods of Predis\Command\ScriptedCommand, falling back
to analyzing the raw arguments array of the command.
Daniele Alessandri 12 년 전
부모
커밋
94c4e2ffee
2개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      lib/Predis/Cluster/RedisClusterHashStrategy.php
  2. 1 1
      tests/Predis/Cluster/RedisClusterHashStrategyTest.php

+ 1 - 0
lib/Predis/Cluster/RedisClusterHashStrategy.php

@@ -13,6 +13,7 @@ namespace Predis\Cluster;
 
 use Predis\Cluster\Hash\CRC16HashGenerator;
 use Predis\Command\CommandInterface;
+use Predis\Command\ScriptedCommand;
 
 /**
  * Default class used by Predis to calculate hashes out of keys of

+ 1 - 1
tests/Predis/Cluster/RedisClusterHashStrategyTest.php

@@ -186,7 +186,7 @@ class RedisClusterHashStrategyTest extends StandardTestCase
         $command->expects($this->once())
                 ->method('getScript')
                 ->will($this->returnValue('return true'));
-        $command->expects($this->exactly(1))
+        $command->expects($this->exactly(2))
                 ->method('getKeysCount')
                 ->will($this->returnValue(1));
         $command->setArguments($arguments);