Procházet zdrojové kódy

Split Predis\Connection\Aggregate namespace.

Now we have two namespaces for cluster and replication backends:

  - Predis\Connection\Cluster
  - Predis\Connection\Replication
Daniele Alessandri před 8 roky
rodič
revize
1028599ac5

+ 4 - 0
CHANGELOG.md

@@ -17,6 +17,10 @@ v2.0.0 (201x-xx-xx)
 
 - Changed the signature for the constructor of `Predis\Command\RawCommand`.
 
+- The `Predis\Connection\Aggregate` namespace has been split into two separate
+  namespaces for cluster backends (`Predis\Connection\Cluster`) and replication
+  backends (`Predis\Connection\Replication`).
+
 
 v1.1.0 (2016-06-02)
 ================================================================================

+ 1 - 1
README.md

@@ -265,7 +265,7 @@ $options    = ['replication' => function () {
     $strategy = new Predis\Replication\ReplicationStrategy();
     $strategy->setScriptReadOnly($LUA_SCRIPT);
 
-    return new Predis\Connection\Aggregate\MasterSlaveReplication($strategy);
+    return new Predis\Connection\Replication\MasterSlaveReplication($strategy);
 }];
 
 $client = new Predis\Client($parameters, $options);

+ 1 - 1
examples/custom_cluster_distributor.php

@@ -18,7 +18,7 @@ require __DIR__.'/shared.php';
 use Predis\Cluster\Distributor\DistributorInterface;
 use Predis\Cluster\Hash\HashGeneratorInterface;
 use Predis\Cluster\PredisStrategy;
-use Predis\Connection\Aggregate\PredisCluster;
+use Predis\Connection\Cluster\PredisCluster;
 
 class NaiveDistributor implements DistributorInterface, HashGeneratorInterface
 {

+ 1 - 1
examples/replication_complex.php

@@ -19,7 +19,7 @@ require __DIR__.'/shared.php';
 // will be executed on slaves.
 
 use Predis\Command\ScriptCommand;
-use Predis\Connection\Aggregate\MasterSlaveReplication;
+use Predis\Connection\Replication\MasterSlaveReplication;
 use Predis\Replication\ReplicationStrategy;
 
 // ------------------------------------------------------------------------- //

+ 4 - 4
src/Configuration/ClusterOption.php

@@ -11,9 +11,9 @@
 
 namespace Predis\Configuration;
 
-use Predis\Connection\Aggregate\ClusterInterface;
-use Predis\Connection\Aggregate\PredisCluster;
-use Predis\Connection\Aggregate\RedisCluster;
+use Predis\Connection\Cluster\ClusterInterface;
+use Predis\Connection\Cluster\PredisCluster;
+use Predis\Connection\Cluster\RedisCluster;
 
 /**
  * Configures an aggregate connection used for clustering
@@ -59,7 +59,7 @@ class ClusterOption implements OptionInterface
 
         if (!$value instanceof ClusterInterface) {
             throw new \InvalidArgumentException(
-                "An instance of type 'Predis\Connection\Aggregate\ClusterInterface' was expected."
+                "An instance of type 'Predis\Connection\Cluster\ClusterInterface' was expected."
             );
         }
 

+ 4 - 4
src/Configuration/ReplicationOption.php

@@ -11,9 +11,9 @@
 
 namespace Predis\Configuration;
 
-use Predis\Connection\Aggregate\MasterSlaveReplication;
-use Predis\Connection\Aggregate\ReplicationInterface;
-use Predis\Connection\Aggregate\SentinelReplication;
+use Predis\Connection\Replication\MasterSlaveReplication;
+use Predis\Connection\Replication\ReplicationInterface;
+use Predis\Connection\Replication\SentinelReplication;
 
 /**
  * Configures an aggregate connection used for master/slave replication among
@@ -54,7 +54,7 @@ class ReplicationOption implements OptionInterface
         }
 
         throw new \InvalidArgumentException(
-            "An instance of type 'Predis\Connection\Aggregate\ReplicationInterface' was expected."
+            "An instance of type 'Predis\Connection\Replication\ReplicationInterface' was expected."
         );
     }
 

+ 1 - 1
src/Connection/Aggregate/ClusterInterface.php → src/Connection/Cluster/ClusterInterface.php

@@ -9,7 +9,7 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection\Aggregate;
+namespace Predis\Connection\Cluster;
 
 use Predis\Connection\AggregateConnectionInterface;
 

+ 1 - 1
src/Connection/Aggregate/PredisCluster.php → src/Connection/Cluster/PredisCluster.php

@@ -9,7 +9,7 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection\Aggregate;
+namespace Predis\Connection\Cluster;
 
 use Predis\Cluster\PredisStrategy;
 use Predis\Cluster\StrategyInterface;

+ 1 - 1
src/Connection/Aggregate/RedisCluster.php → src/Connection/Cluster/RedisCluster.php

@@ -9,7 +9,7 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection\Aggregate;
+namespace Predis\Connection\Cluster;
 
 use Predis\ClientException;
 use Predis\Cluster\RedisStrategy as RedisClusterStrategy;

+ 1 - 1
src/Connection/Aggregate/MasterSlaveReplication.php → src/Connection/Replication/MasterSlaveReplication.php

@@ -9,7 +9,7 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection\Aggregate;
+namespace Predis\Connection\Replication;
 
 use Predis\ClientException;
 use Predis\Command\CommandInterface;

+ 1 - 1
src/Connection/Aggregate/ReplicationInterface.php → src/Connection/Replication/ReplicationInterface.php

@@ -9,7 +9,7 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection\Aggregate;
+namespace Predis\Connection\Replication;
 
 use Predis\Connection\AggregateConnectionInterface;
 use Predis\Connection\NodeConnectionInterface;

+ 1 - 1
src/Connection/Aggregate/SentinelReplication.php → src/Connection/Replication/SentinelReplication.php

@@ -9,7 +9,7 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection\Aggregate;
+namespace Predis\Connection\Replication;
 
 use Predis\Command\CommandInterface;
 use Predis\Command\RawCommand;

+ 1 - 1
src/Pipeline/ConnectionErrorProof.php

@@ -12,7 +12,7 @@
 namespace Predis\Pipeline;
 
 use Predis\CommunicationException;
-use Predis\Connection\Aggregate\ClusterInterface;
+use Predis\Connection\Cluster\ClusterInterface;
 use Predis\Connection\ConnectionInterface;
 use Predis\Connection\NodeConnectionInterface;
 use Predis\NotSupportedException;

+ 1 - 1
src/Pipeline/Pipeline.php

@@ -15,8 +15,8 @@ use Predis\ClientContextInterface;
 use Predis\ClientException;
 use Predis\ClientInterface;
 use Predis\Command\CommandInterface;
-use Predis\Connection\Aggregate\ReplicationInterface;
 use Predis\Connection\ConnectionInterface;
+use Predis\Connection\Replication\ReplicationInterface;
 use Predis\Response\ErrorInterface as ErrorResponseInterface;
 use Predis\Response\ResponseInterface;
 use Predis\Response\ServerException;

+ 11 - 11
tests/Predis/ClientTest.php

@@ -102,7 +102,7 @@ class ClientTest extends PredisTestCase
 
         $client = new Client($arg1);
 
-        $this->assertInstanceOf('Predis\Connection\Aggregate\ClusterInterface', $client->getConnection());
+        $this->assertInstanceOf('Predis\Connection\Cluster\ClusterInterface', $client->getConnection());
     }
 
     /**
@@ -124,7 +124,7 @@ class ClientTest extends PredisTestCase
     {
         $client = new Client($arg1 = array('tcp://localhost:7000', 'tcp://localhost:7001'));
 
-        $this->assertInstanceOf('Predis\Connection\Aggregate\ClusterInterface', $client->getConnection());
+        $this->assertInstanceOf('Predis\Connection\Cluster\ClusterInterface', $client->getConnection());
     }
 
     /**
@@ -137,7 +137,7 @@ class ClientTest extends PredisTestCase
 
         $client = new Client(array($connection1, $connection2));
 
-        $this->assertInstanceOf('Predis\Connection\Aggregate\ClusterInterface', $cluster = $client->getConnection());
+        $this->assertInstanceOf('Predis\Connection\Cluster\ClusterInterface', $cluster = $client->getConnection());
         $this->assertSame($connection1, $cluster->getConnectionById(0));
         $this->assertSame($connection2, $cluster->getConnectionById(1));
     }
@@ -165,14 +165,14 @@ class ClientTest extends PredisTestCase
      */
     public function testConstructorWithClusterArgument()
     {
-        $cluster = new Connection\Aggregate\PredisCluster();
+        $cluster = new Connection\Cluster\PredisCluster();
 
         $factory = new Connection\Factory();
         $factory->aggregate($cluster, array('tcp://localhost:7000', 'tcp://localhost:7001'));
 
         $client = new Client($cluster);
 
-        $this->assertInstanceOf('Predis\Connection\Aggregate\ClusterInterface', $client->getConnection());
+        $this->assertInstanceOf('Predis\Connection\Cluster\ClusterInterface', $client->getConnection());
         $this->assertSame($cluster, $client->getConnection());
     }
 
@@ -181,14 +181,14 @@ class ClientTest extends PredisTestCase
      */
     public function testConstructorWithReplicationArgument()
     {
-        $replication = new Connection\Aggregate\MasterSlaveReplication();
+        $replication = new Connection\Replication\MasterSlaveReplication();
 
         $factory = new Connection\Factory();
         $factory->aggregate($replication, array('tcp://host1?alias=master', 'tcp://host2?alias=slave'));
 
         $client = new Client($replication);
 
-        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $client->getConnection());
+        $this->assertInstanceOf('Predis\Connection\Replication\ReplicationInterface', $client->getConnection());
         $this->assertSame($replication, $client->getConnection());
     }
 
@@ -252,7 +252,7 @@ class ClientTest extends PredisTestCase
         $arg2 = array('replication' => true);
         $client = new Client($arg1, $arg2);
 
-        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $connection = $client->getConnection());
+        $this->assertInstanceOf('Predis\Connection\Replication\ReplicationInterface', $connection = $client->getConnection());
         $this->assertSame('host1', $connection->getConnectionById('master')->getParameters()->host);
         $this->assertSame('host2', $connection->getConnectionById('slave')->getParameters()->host);
     }
@@ -579,7 +579,7 @@ class ClientTest extends PredisTestCase
     {
         $client = new Client(array('tcp://host1?alias=node01', 'tcp://host2?alias=node02'));
 
-        $this->assertInstanceOf('Predis\Connection\Aggregate\ClusterInterface', $cluster = $client->getConnection());
+        $this->assertInstanceOf('Predis\Connection\Cluster\ClusterInterface', $cluster = $client->getConnection());
         $this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $node01 = $client->getConnectionById('node01'));
         $this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $node02 = $client->getConnectionById('node02'));
 
@@ -606,7 +606,7 @@ class ClientTest extends PredisTestCase
     {
         $client = new Client(array('tcp://host1?alias=node01', 'tcp://host2?alias=node02'), array('prefix' => 'pfx:'));
 
-        $this->assertInstanceOf('Predis\Connection\Aggregate\ClusterInterface', $cluster = $client->getConnection());
+        $this->assertInstanceOf('Predis\Connection\Cluster\ClusterInterface', $cluster = $client->getConnection());
         $this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $node01 = $client->getConnectionById('node01'));
         $this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $node02 = $client->getConnectionById('node02'));
 
@@ -823,7 +823,7 @@ class ClientTest extends PredisTestCase
         $connection2 = $this->getMockConnection('tcp://127.0.0.1:6382');
         $connection3 = $this->getMockConnection('tcp://127.0.0.1:6383');
 
-        $aggregate = new \Predis\Connection\Aggregate\PredisCluster();
+        $aggregate = new \Predis\Connection\Cluster\PredisCluster();
 
         $aggregate->add($connection1);
         $aggregate->add($connection2);

+ 6 - 6
tests/Predis/Configuration/ClusterOptionTest.php

@@ -26,7 +26,7 @@ class ClusterOptionTest extends PredisTestCase
         $option = new ClusterOption();
         $options = $this->getMock('Predis\Configuration\OptionsInterface');
 
-        $this->assertInstanceOf('Predis\Connection\Aggregate\PredisCluster', $option->getDefault($options));
+        $this->assertInstanceOf('Predis\Connection\Cluster\PredisCluster', $option->getDefault($options));
     }
 
     /**
@@ -36,7 +36,7 @@ class ClusterOptionTest extends PredisTestCase
     {
         $option = new ClusterOption();
         $options = $this->getMock('Predis\Configuration\OptionsInterface');
-        $cluster = $this->getMock('Predis\Connection\Aggregate\ClusterInterface');
+        $cluster = $this->getMock('Predis\Connection\Cluster\ClusterInterface');
 
         $this->assertSame($cluster, $option->filter($options, $cluster));
     }
@@ -56,11 +56,11 @@ class ClusterOptionTest extends PredisTestCase
                     $this->getMock('Predis\Connection\FactoryInterface')
                 ));
 
-        $this->assertInstanceOf('Predis\Connection\Aggregate\PredisCluster', $option->filter($options, 'predis'));
-        $this->assertInstanceOf('Predis\Connection\Aggregate\PredisCluster', $option->filter($options, 'predis-cluster'));
+        $this->assertInstanceOf('Predis\Connection\Cluster\PredisCluster', $option->filter($options, 'predis'));
+        $this->assertInstanceOf('Predis\Connection\Cluster\PredisCluster', $option->filter($options, 'predis-cluster'));
 
-        $this->assertInstanceOf('Predis\Connection\Aggregate\RedisCluster', $option->filter($options, 'redis'));
-        $this->assertInstanceOf('Predis\Connection\Aggregate\RedisCluster', $option->filter($options, 'redis-cluster'));
+        $this->assertInstanceOf('Predis\Connection\Cluster\RedisCluster', $option->filter($options, 'redis'));
+        $this->assertInstanceOf('Predis\Connection\Cluster\RedisCluster', $option->filter($options, 'redis-cluster'));
     }
 
     /**

+ 6 - 6
tests/Predis/Configuration/OptionsTest.php

@@ -27,8 +27,8 @@ class OptionsTest extends PredisTestCase
 
         $this->assertInstanceOf('Predis\Connection\FactoryInterface', $options->connections);
         $this->assertInstanceOf('Predis\Command\FactoryInterface', $options->commands);
-        $this->assertInstanceOf('Predis\Connection\Aggregate\ClusterInterface', $options->cluster);
-        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $options->replication);
+        $this->assertInstanceOf('Predis\Connection\Cluster\ClusterInterface', $options->cluster);
+        $this->assertInstanceOf('Predis\Connection\Replication\ReplicationInterface', $options->replication);
         $this->assertTrue($options->exceptions);
         $this->assertNull($options->prefix);
     }
@@ -43,16 +43,16 @@ class OptionsTest extends PredisTestCase
             'prefix' => 'prefix:',
             'commands' => $this->getMock('Predis\Command\FactoryInterface'),
             'connections' => $this->getMock('Predis\Connection\FactoryInterface'),
-            'cluster' => $this->getMock('Predis\Connection\Aggregate\ClusterInterface'),
-            'replication' => $this->getMock('Predis\Connection\Aggregate\ReplicationInterface'),
+            'cluster' => $this->getMock('Predis\Connection\Cluster\ClusterInterface'),
+            'replication' => $this->getMock('Predis\Connection\Replication\ReplicationInterface'),
         ));
 
         $this->assertInternalType('bool', $options->exceptions);
         $this->assertInstanceOf('Predis\Command\FactoryInterface', $options->commands);
         $this->assertInstanceOf('Predis\Command\Processor\ProcessorInterface', $options->prefix);
         $this->assertInstanceOf('Predis\Connection\FactoryInterface', $options->connections);
-        $this->assertInstanceOf('Predis\Connection\Aggregate\ClusterInterface', $options->cluster);
-        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $options->replication);
+        $this->assertInstanceOf('Predis\Connection\Cluster\ClusterInterface', $options->cluster);
+        $this->assertInstanceOf('Predis\Connection\Replication\ReplicationInterface', $options->replication);
     }
 
     /**

+ 6 - 6
tests/Predis/Configuration/ReplicationOptionTest.php

@@ -26,8 +26,8 @@ class ReplicationOptionTest extends PredisTestCase
         $option = new ReplicationOption();
         $options = $this->getMock('Predis\Configuration\OptionsInterface');
 
-        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $option->getDefault($options));
-        $this->assertInstanceOf('Predis\Connection\Aggregate\MasterSlaveReplication', $option->getDefault($options));
+        $this->assertInstanceOf('Predis\Connection\Replication\ReplicationInterface', $option->getDefault($options));
+        $this->assertInstanceOf('Predis\Connection\Replication\MasterSlaveReplication', $option->getDefault($options));
     }
 
     /**
@@ -40,16 +40,16 @@ class ReplicationOptionTest extends PredisTestCase
 
         $this->assertNull($option->filter($options, null));
 
-        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $option->filter($options, true));
+        $this->assertInstanceOf('Predis\Connection\Replication\ReplicationInterface', $option->filter($options, true));
         $this->assertNull($option->filter($options, false));
 
-        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $option->filter($options, 1));
+        $this->assertInstanceOf('Predis\Connection\Replication\ReplicationInterface', $option->filter($options, 1));
         $this->assertNull($option->filter($options, 0));
 
-        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $option->filter($options, 'true'));
+        $this->assertInstanceOf('Predis\Connection\Replication\ReplicationInterface', $option->filter($options, 'true'));
         $this->assertNull($option->filter($options, 'false'));
 
-        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $option->filter($options, 'on'));
+        $this->assertInstanceOf('Predis\Connection\Replication\ReplicationInterface', $option->filter($options, 'on'));
         $this->assertNull($option->filter($options, 'off'));
     }
 

+ 1 - 1
tests/Predis/Connection/Aggregate/PredisClusterTest.php → tests/Predis/Connection/Cluster/PredisClusterTest.php

@@ -9,7 +9,7 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection\Aggregate;
+namespace Predis\Connection\Cluster;
 
 use PredisTestCase;
 

+ 5 - 5
tests/Predis/Connection/Aggregate/RedisClusterTest.php → tests/Predis/Connection/Cluster/RedisClusterTest.php

@@ -9,7 +9,7 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection\Aggregate;
+namespace Predis\Connection\Cluster;
 
 use Predis\Command;
 use Predis\Connection;
@@ -300,7 +300,7 @@ class RedisClusterTest extends PredisTestCase
                  ->will($this->returnValue($connection4));
 
         // TODO: I'm not sure about mocking a protected method, but it'll do for now
-        $cluster = $this->getMock('Predis\Connection\Aggregate\RedisCluster', array('getRandomConnection'), array($factory));
+        $cluster = $this->getMock('Predis\Connection\Cluster\RedisCluster', array('getRandomConnection'), array($factory));
         $cluster->expects($this->exactly(1))
                 ->method('getRandomConnection')
                 ->will($this->returnValue($connection1));
@@ -669,7 +669,7 @@ class RedisClusterTest extends PredisTestCase
                  ->will($this->returnValue($connection4));
 
         // TODO: I'm not sure about mocking a protected method, but it'll do for now
-        $cluster = $this->getMock('Predis\Connection\Aggregate\RedisCluster', array('getRandomConnection'), array($factory));
+        $cluster = $this->getMock('Predis\Connection\Cluster\RedisCluster', array('getRandomConnection'), array($factory));
         $cluster->expects($this->never())
                 ->method('getRandomConnection');
 
@@ -755,7 +755,7 @@ class RedisClusterTest extends PredisTestCase
         $factory->expects($this->never())->method('create');
 
         // TODO: I'm not sure about mocking a protected method, but it'll do for now
-        $cluster = $this->getMock('Predis\Connection\Aggregate\RedisCluster', array('getRandomConnection'), array($factory));
+        $cluster = $this->getMock('Predis\Connection\Cluster\RedisCluster', array('getRandomConnection'), array($factory));
         $cluster->expects($this->exactly(3))
                 ->method('getRandomConnection')
                 ->will($this->onConsecutiveCalls($connection1, $connection2, $connection3));
@@ -808,7 +808,7 @@ class RedisClusterTest extends PredisTestCase
         $factory->expects($this->never())->method('create');
 
         // TODO: I'm not sure about mocking a protected method, but it'll do for now
-        $cluster = $this->getMock('Predis\Connection\Aggregate\RedisCluster', array('getRandomConnection'), array($factory));
+        $cluster = $this->getMock('Predis\Connection\Cluster\RedisCluster', array('getRandomConnection'), array($factory));
         $cluster->expects($this->exactly(2))
                 ->method('getRandomConnection')
                 ->will($this->onConsecutiveCalls($connection1, $connection2));

+ 3 - 3
tests/Predis/Connection/FactoryTest.php

@@ -427,7 +427,7 @@ class FactoryTest extends PredisTestCase
     {
         list(, $connectionClass) = $this->getMockConnectionClass();
 
-        $cluster = $this->getMock('Predis\Connection\Aggregate\ClusterInterface');
+        $cluster = $this->getMock('Predis\Connection\Cluster\ClusterInterface');
         $cluster->expects($this->exactly(2))
                 ->method('add')
                 ->with($this->isInstanceOf('Predis\Connection\NodeConnectionInterface'));
@@ -446,7 +446,7 @@ class FactoryTest extends PredisTestCase
     {
         list(, $connectionClass) = $this->getMockConnectionClass();
 
-        $cluster = $this->getMock('Predis\Connection\Aggregate\ClusterInterface');
+        $cluster = $this->getMock('Predis\Connection\Cluster\ClusterInterface');
         $cluster->expects($this->exactly(4))
                 ->method('add')
                 ->with($this->isInstanceOf('Predis\Connection\NodeConnectionInterface'));
@@ -466,7 +466,7 @@ class FactoryTest extends PredisTestCase
      */
     public function testAggregateConnectionWithEmptyListOfParameters()
     {
-        $cluster = $this->getMock('Predis\Connection\Aggregate\ClusterInterface');
+        $cluster = $this->getMock('Predis\Connection\Cluster\ClusterInterface');
         $cluster->expects($this->never())->method('add');
 
         $factory = $this->getMock('Predis\Connection\Factory', array('create'));

+ 1 - 1
tests/Predis/Connection/Aggregate/MasterSlaveReplicationTest.php → tests/Predis/Connection/Replication/MasterSlaveReplicationTest.php

@@ -9,7 +9,7 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection\Aggregate;
+namespace Predis\Connection\Replication;
 
 use Predis\Command;
 use Predis\Connection;

+ 1 - 1
tests/Predis/Connection/Aggregate/SentinelReplicationTest.php → tests/Predis/Connection/Replication/SentinelReplicationTest.php

@@ -9,7 +9,7 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection\Aggregate;
+namespace Predis\Connection\Replication;
 
 use Predis\Command;
 use Predis\Connection;

+ 1 - 1
tests/Predis/Monitor/ConsumerTest.php

@@ -45,7 +45,7 @@ class ConsumerTest extends PredisTestCase
      */
     public function testMonitorConsumerDoesNotWorkOnClusters()
     {
-        $cluster = $this->getMock('Predis\Connection\Aggregate\ClusterInterface');
+        $cluster = $this->getMock('Predis\Connection\AggregateConnectionInterface');
         $client = new Client($cluster);
 
         new MonitorConsumer($client);

+ 1 - 1
tests/Predis/Pipeline/AtomicTest.php

@@ -153,7 +153,7 @@ class AtomicTest extends PredisTestCase
      */
     public function testExecutorWithAggregateConnection()
     {
-        $connection = $this->getMock('Predis\Connection\Aggregate\ClusterInterface');
+        $connection = $this->getMock('Predis\Connection\AggregateConnectionInterface');
         $pipeline = new Atomic(new Client($connection));
 
         $pipeline->ping();

+ 1 - 1
tests/Predis/Pipeline/FireAndForgetTest.php

@@ -42,7 +42,7 @@ class FireAndForgetTest extends PredisTestCase
      */
     public function testSwitchesToMasterWithReplicationConnection()
     {
-        $connection = $this->getMock('Predis\Connection\Aggregate\ReplicationInterface');
+        $connection = $this->getMock('Predis\Connection\Replication\ReplicationInterface');
         $connection->expects($this->once())
                    ->method('switchTo')
                    ->with('master');

+ 1 - 1
tests/Predis/Pipeline/PipelineTest.php

@@ -240,7 +240,7 @@ class PipelineTest extends PredisTestCase
     {
         $pong = new Response\Status('PONG');
 
-        $connection = $this->getMock('Predis\Connection\Aggregate\ReplicationInterface');
+        $connection = $this->getMock('Predis\Connection\Replication\ReplicationInterface');
         $connection->expects($this->once())
                    ->method('switchTo')
                    ->with('master');

+ 1 - 1
tests/Predis/PubSub/ConsumerTest.php

@@ -44,7 +44,7 @@ class ConsumerTest extends PredisTestCase
      */
     public function testPubSubConsumerDoesNotWorkOnClusters()
     {
-        $cluster = $this->getMock('Predis\Connection\Aggregate\ClusterInterface');
+        $cluster = $this->getMock('Predis\Connection\Cluster\ClusterInterface');
         $client = new Client($cluster);
 
         new PubSubConsumer($client);