Move the PipelineContext class in the Predis\Pipeline namespace.

This commit is contained in:
Daniele Alessandri
2011-06-02 16:03:33 +02:00
parent fb3088b4d3
commit e048ac2d51
3 changed files with 11 additions and 8 deletions
+1
View File
@@ -7,6 +7,7 @@ use Predis\Network\IConnection;
use Predis\Network\IConnectionSingle;
use Predis\Profiles\IServerProfile;
use Predis\Profiles\ServerProfile;
use Predis\Pipeline\PipelineContext;
class Client {
const VERSION = '0.7.0-dev';
@@ -1,16 +1,17 @@
<?php
namespace Predis;
namespace Predis\Pipeline;
use Predis\Client;
use Predis\ClientException;
use Predis\Commands\ICommand;
use Predis\Pipeline\IPipelineExecutor;
class PipelineContext {
private $_client, $_pipelineBuffer, $_returnValues, $_running, $_executor;
public function __construct(Client $client, IPipelineExecutor $executor = null) {
$this->_client = $client;
$this->_executor = $executor ?: new Pipeline\StandardExecutor();
$this->_executor = $executor ?: new StandardExecutor();
$this->_pipelineBuffer = array();
$this->_returnValues = array();
}
+6 -5
View File
@@ -390,14 +390,15 @@ class ClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
$client->flushdb();
$pipe = $client->pipeline();
$pipelineClass = '\Predis\Pipeline\PipelineContext';
$this->assertInstanceOf('\Predis\PipelineContext', $pipe);
$this->assertInstanceOf('\Predis\PipelineContext', $pipe->set('foo', 'bar'));
$this->assertInstanceOf('\Predis\PipelineContext', $pipe->set('hoge', 'piyo'));
$this->assertInstanceOf('\Predis\PipelineContext', $pipe->mset(array(
$this->assertInstanceOf($pipelineClass, $pipe);
$this->assertInstanceOf($pipelineClass, $pipe->set('foo', 'bar'));
$this->assertInstanceOf($pipelineClass, $pipe->set('hoge', 'piyo'));
$this->assertInstanceOf($pipelineClass, $pipe->mset(array(
'foofoo' => 'barbar', 'hogehoge' => 'piyopiyo'
)));
$this->assertInstanceOf('\Predis\PipelineContext', $pipe->mget(array(
$this->assertInstanceOf($pipelineClass, $pipe->mget(array(
'foo', 'hoge', 'foofoo', 'hogehoge'
)));