mirror of
https://github.com/predis/predis.git
synced 2026-08-30 04:02:22 +00:00
Make sure raw commands IDs are normalized to uppercase.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user