mirror of
https://github.com/predis/predis.git
synced 2026-08-20 18:31:48 +00:00
Make Pipeline::executeCommand() return $this for fluent interface.
This commit is contained in:
@@ -76,11 +76,14 @@ class Pipeline implements BasicClientInterface, ExecutableContextInterface
|
||||
/**
|
||||
* Queues a command instance into the pipeline buffer.
|
||||
*
|
||||
* @param CommandInterface $command Command to be queued in the buffer.
|
||||
* @param CommandInterface $command Command instance to be queued in the buffer.
|
||||
* @return self
|
||||
*/
|
||||
public function executeCommand(CommandInterface $command)
|
||||
{
|
||||
$this->recordCommand($command);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -129,6 +129,19 @@ class PipelineTest extends PredisTestCase
|
||||
$this->assertSame(array($error, $error), $pipeline->execute());
|
||||
}
|
||||
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
public function testExecuteReturnsPipelineForFluentInterface()
|
||||
{
|
||||
$profile = Profile\Factory::getDefault();
|
||||
$connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
|
||||
$pipeline = new Pipeline(new Client($connection));
|
||||
$command = $profile->createCommand('echo', array('one'));
|
||||
|
||||
$this->assertSame($pipeline, $pipeline->executeCommand($command));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user