mirror of
https://github.com/predis/predis.git
synced 2026-09-19 06:47:39 +00:00
Move the PipelineContext class in the Predis\Pipeline namespace.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
@@ -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'
|
||||
)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user