Make sure raw commands IDs are normalized to uppercase.

This commit is contained in:
Daniele Alessandri
2013-12-02 11:41:15 +01:00
parent c3c819cc9c
commit 381023ad8f
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ class RawCommand implements CommandInterface
throw new InvalidArgumentException("Arguments array is missing the command ID");
}
$this->commandID = array_shift($arguments);
$this->commandID = strtoupper(array_shift($arguments));
$this->arguments = $arguments;
}
+10
View File
@@ -126,6 +126,16 @@ class RawCommandTest extends PredisTestCase
$this->assertNull($command->getHash());
}
/**
* @group disconnected
*/
public function testNormalizesCommandIdentifiersToUppercase()
{
$command = new RawCommand(array('set', 'key', 'value'));
$this->assertSame('SET', $command->getId());
}
/**
* @group disconnected
*/