Przeglądaj źródła

[tests] Normalize casing of command identifiers in constraint.

We do not care much about the casing of command IDs in our constraint,
so it makes no difference for use if it is "SET" or "set".
Daniele Alessandri 12 lat temu
rodzic
commit
e1f6c8644f
1 zmienionych plików z 4 dodań i 4 usunięć
  1. 4 4
      tests/PHPUnit/RedisCommandConstraint.php

+ 4 - 4
tests/PHPUnit/RedisCommandConstraint.php

@@ -25,10 +25,10 @@ class RedisCommandConstraint extends PHPUnit_Framework_Constraint
     public function __construct($command = null, array $arguments = null)
     public function __construct($command = null, array $arguments = null)
     {
     {
         if ($command instanceof CommandInterface) {
         if ($command instanceof CommandInterface) {
-            $this->commandID = $command->getId();
+            $this->commandID = strtoupper($command->getId());
             $this->arguments = $arguments ?: $commant->getArguments();
             $this->arguments = $arguments ?: $commant->getArguments();
         } else {
         } else {
-            $this->commandID = $command;
+            $this->commandID = strtoupper($command);
             $this->arguments = $arguments;
             $this->arguments = $arguments;
         }
         }
     }
     }
@@ -42,7 +42,7 @@ class RedisCommandConstraint extends PHPUnit_Framework_Constraint
             return false;
             return false;
         }
         }
 
 
-        if ($this->commandID && $other->getId() !== $this->commandID) {
+        if ($this->commandID && strtoupper($other->getId()) !== $this->commandID) {
             return false;
             return false;
         }
         }
 
 
@@ -74,7 +74,7 @@ class RedisCommandConstraint extends PHPUnit_Framework_Constraint
         $string = 'is a Redis command';
         $string = 'is a Redis command';
 
 
         if ($this->commandID) {
         if ($this->commandID) {
-            $string .= " with ID `{$this->commandID}";
+            $string .= " with ID '{$this->commandID}'";
         }
         }
 
 
         if ($this->arguments) {
         if ($this->arguments) {