|
@@ -24,7 +24,7 @@ class RawCommandTest extends PredisTestCase
|
|
|
public function testConstructorWithCommandID()
|
|
|
{
|
|
|
$commandID = 'PING';
|
|
|
- $command = new RawCommand(array($commandID));
|
|
|
+ $command = new RawCommand($commandID);
|
|
|
|
|
|
$this->assertSame($commandID, $command->getId());
|
|
|
$this->assertEmpty($command->getArguments());
|
|
@@ -38,7 +38,7 @@ class RawCommandTest extends PredisTestCase
|
|
|
$commandID = 'SET';
|
|
|
$commandArgs = array('foo', 'bar');
|
|
|
|
|
|
- $command = new RawCommand(array_merge((array) $commandID, $commandArgs));
|
|
|
+ $command = new RawCommand($commandID, $commandArgs);
|
|
|
|
|
|
$this->assertSame($commandID, $command->getId());
|
|
|
$this->assertSame($commandArgs, $command->getArguments());
|
|
@@ -58,16 +58,6 @@ class RawCommandTest extends PredisTestCase
|
|
|
$this->assertSame(array('foo', 'bar'), $command->getArguments());
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @group disconnected
|
|
|
- * @expectedException \InvalidArgumentException
|
|
|
- * @expectedExceptionMessage The arguments array must contain at least the command ID.
|
|
|
- */
|
|
|
- public function testExceptionOnMissingCommandID()
|
|
|
- {
|
|
|
- new RawCommand(array());
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* The signature of RawCommand::create() requires one argument which is the
|
|
|
* ID of the command (other arguments are fetched dinamically). If the first
|
|
@@ -87,7 +77,7 @@ class RawCommandTest extends PredisTestCase
|
|
|
public function testSetArguments()
|
|
|
{
|
|
|
$commandID = 'SET';
|
|
|
- $command = new RawCommand(array($commandID));
|
|
|
+ $command = new RawCommand($commandID);
|
|
|
|
|
|
$command->setArguments($commandArgs = array('foo', 'bar'));
|
|
|
$this->assertSame($commandArgs, $command->getArguments());
|
|
@@ -102,7 +92,7 @@ class RawCommandTest extends PredisTestCase
|
|
|
public function testSetRawArguments()
|
|
|
{
|
|
|
$commandID = 'SET';
|
|
|
- $command = new RawCommand(array($commandID));
|
|
|
+ $command = new RawCommand($commandID);
|
|
|
|
|
|
$command->setRawArguments($commandArgs = array('foo', 'bar'));
|
|
|
$this->assertSame($commandArgs, $command->getArguments());
|
|
@@ -117,8 +107,8 @@ class RawCommandTest extends PredisTestCase
|
|
|
public function testSetAndGetHash()
|
|
|
{
|
|
|
$slot = 1024;
|
|
|
- $arguments = array('SET', 'key', 'value');
|
|
|
- $command = new RawCommand($arguments);
|
|
|
+ $arguments = array('key', 'value');
|
|
|
+ $command = new RawCommand('SET', $arguments);
|
|
|
|
|
|
$this->assertNull($command->getSlot());
|
|
|
|
|
@@ -134,7 +124,7 @@ class RawCommandTest extends PredisTestCase
|
|
|
*/
|
|
|
public function testNormalizesCommandIdentifiersToUppercase()
|
|
|
{
|
|
|
- $command = new RawCommand(array('set', 'key', 'value'));
|
|
|
+ $command = new RawCommand('set', array('key', 'value'));
|
|
|
|
|
|
$this->assertSame('SET', $command->getId());
|
|
|
}
|