浏览代码

Move command "COMMAND" to the server profile for Redis 2.8.

This command has been backported from the "unstable" branch of Redis
to the "2.8" one, and it is available since 2.8.13.
Daniele Alessandri 11 年之前
父节点
当前提交
dedc1ba0a9

+ 3 - 0
src/Profile/RedisVersion280.php

@@ -254,6 +254,9 @@ class RedisVersion280 extends RedisProfile
             'PFADD'                     => 'Predis\Command\HyperLogLogAdd',
             'PFCOUNT'                   => 'Predis\Command\HyperLogLogCount',
             'PFMERGE'                   => 'Predis\Command\HyperLogLogMerge',
+
+            /* remote server control commands */
+            'COMMAND'                   => 'Predis\Command\ServerCommand',
         );
     }
 }

+ 3 - 2
src/Profile/RedisVersion300.php

@@ -255,10 +255,11 @@ class RedisVersion300 extends RedisProfile
             'PFCOUNT'                   => 'Predis\Command\HyperLogLogCount',
             'PFMERGE'                   => 'Predis\Command\HyperLogLogMerge',
 
-            /* ---------------- Redis 3.0 ---------------- */
-
             /* remote server control commands */
             'COMMAND'                   => 'Predis\Command\ServerCommand',
+
+            /* ---------------- Redis 3.0 ---------------- */
+
         );
     }
 }

+ 3 - 0
tests/Predis/Command/ServerCommandTest.php

@@ -84,6 +84,7 @@ class ServerCommandTest extends PredisCommandTestCase
 
     /**
      * @group connected
+     * @requiresRedisVersion >= 2.8.13
      */
     public function testReturnsEmptyCommandInfoOnNonExistingCommand()
     {
@@ -95,6 +96,7 @@ class ServerCommandTest extends PredisCommandTestCase
 
     /**
      * @group connected
+     * @requiresRedisVersion >= 2.8.13
      */
     public function testReturnsCommandInfoOnExistingCommand()
     {
@@ -112,6 +114,7 @@ class ServerCommandTest extends PredisCommandTestCase
 
     /**
      * @group connected
+     * @requiresRedisVersion >= 2.8.13
      */
     public function testReturnsListOfCommandInfoWithNoArguments()
     {

+ 1 - 0
tests/Predis/Profile/RedisVersion280Test.php

@@ -185,6 +185,7 @@ class RedisVersion280Test extends PredisProfileTestCase
             144 => 'PFADD',
             145 => 'PFCOUNT',
             146 => 'PFMERGE',
+            147 => 'COMMAND',
         );
     }
 }