Prechádzať zdrojové kódy

Merge branch 'v1.0.0-dev/connection-namespace'

Daniele Alessandri 10 rokov pred
rodič
commit
5c935d97bd
70 zmenil súbory, kde vykonal 331 pridanie a 315 odobranie
  1. 3 0
      CHANGELOG.md
  2. 2 2
      README.md
  3. 1 1
      examples/custom_cluster_distributor.php
  4. 1 1
      examples/replication_complex.php
  5. 2 2
      lib/Predis/Client.php
  6. 2 1
      lib/Predis/Command/ServerInfo.php
  7. 7 7
      lib/Predis/CommunicationException.php
  8. 8 8
      lib/Predis/Configuration/ClusterOption.php
  9. 5 5
      lib/Predis/Configuration/ReplicationOption.php
  10. 1 1
      lib/Predis/Connection/AbstractConnection.php
  11. 4 2
      lib/Predis/Connection/Aggregate/ClusterInterface.php
  12. 7 6
      lib/Predis/Connection/Aggregate/MasterSlaveReplication.php
  13. 7 6
      lib/Predis/Connection/Aggregate/PredisCluster.php
  14. 18 15
      lib/Predis/Connection/Aggregate/RedisCluster.php
  15. 7 5
      lib/Predis/Connection/Aggregate/ReplicationInterface.php
  16. 9 9
      lib/Predis/Connection/AggregateConnectionInterface.php
  17. 1 1
      lib/Predis/Connection/CompositeConnectionInterface.php
  18. 1 1
      lib/Predis/Connection/CompositeStreamConnection.php
  19. 7 7
      lib/Predis/Connection/Factory.php
  20. 2 2
      lib/Predis/Connection/FactoryInterface.php
  21. 1 1
      lib/Predis/Connection/NodeConnectionInterface.php
  22. 1 1
      lib/Predis/Connection/WebdisConnection.php
  23. 2 2
      lib/Predis/Pipeline/Atomic.php
  24. 6 6
      lib/Predis/Pipeline/ConnectionErrorProof.php
  25. 2 2
      lib/Predis/Pipeline/Pipeline.php
  26. 6 6
      lib/Predis/Protocol/ProtocolProcessorInterface.php
  27. 3 3
      lib/Predis/Protocol/ResponseReaderInterface.php
  28. 5 5
      lib/Predis/Protocol/Text/CompositeProtocolProcessor.php
  29. 2 2
      lib/Predis/Protocol/Text/Handler/BulkResponse.php
  30. 2 2
      lib/Predis/Protocol/Text/Handler/ErrorResponse.php
  31. 2 2
      lib/Predis/Protocol/Text/Handler/IntegerResponse.php
  32. 2 2
      lib/Predis/Protocol/Text/Handler/MultiBulkResponse.php
  33. 4 4
      lib/Predis/Protocol/Text/Handler/ResponseHandlerInterface.php
  34. 2 2
      lib/Predis/Protocol/Text/Handler/StatusResponse.php
  35. 2 2
      lib/Predis/Protocol/Text/Handler/StreamableMultiBulkResponse.php
  36. 3 3
      lib/Predis/Protocol/Text/ProtocolProcessor.php
  37. 5 5
      lib/Predis/Protocol/Text/ResponseReader.php
  38. 4 4
      lib/Predis/Response/Iterator/MultiBulk.php
  39. 1 1
      lib/Predis/Transaction/MultiExec.php
  40. 25 25
      tests/Predis/ClientTest.php
  41. 8 8
      tests/Predis/CommunicationExceptionTest.php
  42. 8 8
      tests/Predis/Configuration/ClusterOptionTest.php
  43. 1 1
      tests/Predis/Configuration/ConnectionFactoryOptionTest.php
  44. 6 6
      tests/Predis/Configuration/OptionsTest.php
  45. 7 7
      tests/Predis/Configuration/ReplicationOptionTest.php
  46. 5 4
      tests/Predis/Connection/Aggregate/MasterSlaveReplicationTest.php
  47. 7 6
      tests/Predis/Connection/Aggregate/PredisClusterTest.php
  48. 5 4
      tests/Predis/Connection/Aggregate/RedisClusterTest.php
  49. 6 6
      tests/Predis/Connection/ComposableStreamConnectionTest.php
  50. 1 1
      tests/Predis/Connection/ConnectionExceptionTest.php
  51. 13 13
      tests/Predis/Connection/FactoryTest.php
  52. 6 6
      tests/Predis/Monitor/ConsumerTest.php
  53. 6 6
      tests/Predis/Pipeline/AtomicTest.php
  54. 2 2
      tests/Predis/Pipeline/FireAndForgetTest.php
  55. 13 13
      tests/Predis/Pipeline/PipelineTest.php
  56. 2 2
      tests/Predis/Protocol/ProtocolExceptionTest.php
  57. 9 9
      tests/Predis/Protocol/Text/CompositeProtocolProcessorTest.php
  58. 4 4
      tests/Predis/Protocol/Text/Handler/BulkResponseTest.php
  59. 1 1
      tests/Predis/Protocol/Text/Handler/ErrorResponseTest.php
  60. 3 3
      tests/Predis/Protocol/Text/Handler/IntegerResponseTest.php
  61. 4 4
      tests/Predis/Protocol/Text/Handler/MultiBulkResponseTest.php
  62. 3 3
      tests/Predis/Protocol/Text/Handler/StatusResponseTest.php
  63. 2 2
      tests/Predis/Protocol/Text/Handler/StreamableMultiBulkResponseTest.php
  64. 4 4
      tests/Predis/Protocol/Text/ProtocolProcessorTest.php
  65. 4 4
      tests/Predis/Protocol/Text/ResponseReaderTest.php
  66. 12 12
      tests/Predis/PubSub/ConsumerTest.php
  67. 2 2
      tests/Predis/Response/Iterator/MultiBulkTest.php
  68. 4 4
      tests/Predis/Response/Iterator/MultiBulkTupleTest.php
  69. 7 7
      tests/Predis/Transaction/MultiExecTest.php
  70. 1 1
      tests/bootstrap.php

+ 3 - 0
CHANGELOG.md

@@ -72,6 +72,9 @@ v1.0.0 (201x-xx-xx)
   its constructor accepts only named arrays, but instances can still be created
   using both URIs or arrays using the static method `Parameters::create()`.
 
+- The `Predis\Connection` namespace has been completely reorganized by renaming
+  a few classes and interfaces and adding some sub-namespaces.
+
 - Most classes and interfaces in the `Predis\Protocol` namespace have been moved
   or renamed while rationalizing the whole API for external protocol processors.
 

+ 2 - 2
README.md

@@ -195,10 +195,10 @@ $client = new Predis\Client('tcp://127.0.0.1', [
 
 Developers can create their own connection classes to add support for new network backends, extend
 existing ones or provide completely different implementations. Connection classes must implement
-`Predis\Connection\SingleConnectionInterface` or extend `Predis\Connection\AbstractConnection`:
+`Predis\Connection\NodeConnectionInterface` or extend `Predis\Connection\AbstractConnection`:
 
 ```php
-class MyConnectionClass implements Predis\Connection\SingleConnectionInterface
+class MyConnectionClass implements Predis\Connection\NodeConnectionInterface
 {
     // Implementation goes here...
 }

+ 1 - 1
examples/custom_cluster_distributor.php

@@ -15,7 +15,7 @@ require __DIR__.'/shared.php';
 // their own distributors used by the client to distribute keys among a cluster
 // of servers.
 
-use Predis\Connection\PredisCluster;
+use Predis\Connection\Aggregate\PredisCluster;
 use Predis\Cluster\Distributor\DistributorInterface;
 use Predis\Cluster\Hash\HashGeneratorInterface;
 

+ 1 - 1
examples/replication_complex.php

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

+ 2 - 2
lib/Predis/Client.php

@@ -241,8 +241,8 @@ class Client implements ClientInterface
      * Retrieves the specified connection from the aggregate connection when the
      * client is in cluster or replication mode.
      *
-     * @param  string                               $connectionID Index or alias of the single connection.
-     * @return Connection\SingleConnectionInterface
+     * @param  string                             $connectionID Index or alias of the single connection.
+     * @return Connection\NodeConnectionInterface
      */
     public function getConnectionById($connectionID)
     {

+ 2 - 1
lib/Predis/Command/ServerInfo.php

@@ -48,7 +48,7 @@ class ServerInfo extends Command
     /**
      * Parses a single row of the response and returns the key-value pair.
      *
-     * @param string $row Single row of the response.
+     * @param  string $row Single row of the response.
      * @return array
      */
     protected function parseRow($row)
@@ -62,6 +62,7 @@ class ServerInfo extends Command
         } else {
             $v = $this->parseDatabaseStats($v);
         }
+
         return array($k, $v);
     }
 

+ 7 - 7
lib/Predis/CommunicationException.php

@@ -12,7 +12,7 @@
 namespace Predis;
 
 use Exception;
-use Predis\Connection\SingleConnectionInterface;
+use Predis\Connection\NodeConnectionInterface;
 
 /**
  * Base exception class for network-related errors.
@@ -24,13 +24,13 @@ abstract class CommunicationException extends PredisException
     private $connection;
 
     /**
-     * @param SingleConnectionInterface $connection     Connection that generated the exception.
-     * @param string                    $message        Error message.
-     * @param int                       $code           Error code.
-     * @param Exception                 $innerException Inner exception for wrapping the original error.
+     * @param NodeConnectionInterface $connection     Connection that generated the exception.
+     * @param string                  $message        Error message.
+     * @param int                     $code           Error code.
+     * @param Exception               $innerException Inner exception for wrapping the original error.
      */
     public function __construct(
-        SingleConnectionInterface $connection,
+        NodeConnectionInterface $connection,
         $message = null,
         $code = null,
         Exception $innerException = null
@@ -42,7 +42,7 @@ abstract class CommunicationException extends PredisException
     /**
      * Gets the connection that generated the exception.
      *
-     * @return SingleConnectionInterface
+     * @return NodeConnectionInterface
      */
     public function getConnection()
     {

+ 8 - 8
lib/Predis/Configuration/ClusterOption.php

@@ -12,9 +12,9 @@
 namespace Predis\Configuration;
 
 use InvalidArgumentException;
-use Predis\Connection\ClusterConnectionInterface;
-use Predis\Connection\PredisCluster;
-use Predis\Connection\RedisCluster;
+use Predis\Connection\Aggregate\ClusterInterface;
+use Predis\Connection\Aggregate\PredisCluster;
+use Predis\Connection\Aggregate\RedisCluster;
 
 /**
  * Configures an aggregate connection used for clustering
@@ -28,9 +28,9 @@ class ClusterOption implements OptionInterface
     /**
      * Creates a new cluster connection from on a known descriptive name.
      *
-     * @param  OptionsInterface           $options Instance of the client options.
-     * @param  string                     $id      Descriptive identifier of the cluster type (`predis`, `redis-cluster`)
-     * @return ClusterConnectionInterface
+     * @param  OptionsInterface $options Instance of the client options.
+     * @param  string           $id      Descriptive identifier of the cluster type (`predis`, `redis-cluster`)
+     * @return ClusterInterface
      */
     protected function createByDescription(OptionsInterface $options, $id)
     {
@@ -55,9 +55,9 @@ class ClusterOption implements OptionInterface
             $value = $this->createByDescription($options, $value);
         }
 
-        if (!$value instanceof ClusterConnectionInterface) {
+        if (!$value instanceof ClusterInterface) {
             throw new InvalidArgumentException(
-                "An instance of type 'Predis\Connection\ClusterConnectionInterface' was expected."
+                "An instance of type 'Predis\Connection\Aggregate\ClusterInterface' was expected."
             );
         }
 

+ 5 - 5
lib/Predis/Configuration/ReplicationOption.php

@@ -12,11 +12,11 @@
 namespace Predis\Configuration;
 
 use InvalidArgumentException;
-use Predis\Connection\MasterSlaveReplication;
-use Predis\Connection\ReplicationConnectionInterface;
+use Predis\Connection\Aggregate\MasterSlaveReplication;
+use Predis\Connection\Aggregate\ReplicationInterface;
 
 /**
- * Configures an aggregate connection used for master/slave replication between
+ * Configures an aggregate connection used for master/slave replication among
  * multiple Redis nodes.
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
@@ -32,7 +32,7 @@ class ReplicationOption implements OptionInterface
      */
     public function filter(OptionsInterface $options, $value)
     {
-        if ($value instanceof ReplicationConnectionInterface) {
+        if ($value instanceof ReplicationInterface) {
             return $value;
         }
 
@@ -48,7 +48,7 @@ class ReplicationOption implements OptionInterface
         }
 
         throw new InvalidArgumentException(
-            "An instance of type 'Predis\Connection\ReplicationConnectionInterface' was expected."
+            "An instance of type 'Predis\Connection\Aggregate\ReplicationInterface' was expected."
         );
     }
 

+ 1 - 1
lib/Predis/Connection/AbstractConnection.php

@@ -22,7 +22,7 @@ use Predis\Protocol\ProtocolException;
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-abstract class AbstractConnection implements SingleConnectionInterface
+abstract class AbstractConnection implements NodeConnectionInterface
 {
     private $resource;
     private $cachedId;

+ 4 - 2
lib/Predis/Connection/ClusterConnectionInterface.php → lib/Predis/Connection/Aggregate/ClusterInterface.php

@@ -9,7 +9,9 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection;
+namespace Predis\Connection\Aggregate;
+
+use Predis\Connection\AggregateConnectionInterface;
 
 /**
  * Defines a cluster of Redis servers formed by aggregating multiple connection
@@ -17,6 +19,6 @@ namespace Predis\Connection;
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-interface ClusterConnectionInterface extends AggregateConnectionInterface
+interface ClusterInterface extends AggregateConnectionInterface
 {
 }

+ 7 - 6
lib/Predis/Connection/MasterSlaveReplication.php → lib/Predis/Connection/Aggregate/MasterSlaveReplication.php

@@ -9,11 +9,12 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection;
+namespace Predis\Connection\Aggregate;
 
 use InvalidArgumentException;
 use RuntimeException;
 use Predis\Command\CommandInterface;
+use Predis\Connection\NodeConnectionInterface;
 use Predis\Replication\ReplicationStrategy;
 
 /**
@@ -22,7 +23,7 @@ use Predis\Replication\ReplicationStrategy;
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class MasterSlaveReplication implements ReplicationConnectionInterface
+class MasterSlaveReplication implements ReplicationInterface
 {
     protected $strategy;
     protected $master;
@@ -59,7 +60,7 @@ class MasterSlaveReplication implements ReplicationConnectionInterface
     /**
      * {@inheritdoc}
      */
-    public function add(SingleConnectionInterface $connection)
+    public function add(NodeConnectionInterface $connection)
     {
         $alias = $connection->getParameters()->alias;
 
@@ -75,7 +76,7 @@ class MasterSlaveReplication implements ReplicationConnectionInterface
     /**
      * {@inheritdoc}
      */
-    public function remove(SingleConnectionInterface $connection)
+    public function remove(NodeConnectionInterface $connection)
     {
         if ($connection->getParameters()->alias === 'master') {
             $this->master = null;
@@ -142,7 +143,7 @@ class MasterSlaveReplication implements ReplicationConnectionInterface
     {
         $this->check();
 
-        if (!$connection instanceof SingleConnectionInterface) {
+        if (!$connection instanceof NodeConnectionInterface) {
             $connection = $this->getConnectionById($connection);
         }
         if ($connection !== $this->master && !in_array($connection, $this->slaves, true)) {
@@ -189,7 +190,7 @@ class MasterSlaveReplication implements ReplicationConnectionInterface
     /**
      * Returns a random slave.
      *
-     * @return SingleConnectionInterface
+     * @return NodeConnectionInterface
      */
     protected function pickSlave()
     {

+ 7 - 6
lib/Predis/Connection/PredisCluster.php → lib/Predis/Connection/Aggregate/PredisCluster.php

@@ -9,7 +9,7 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection;
+namespace Predis\Connection\Aggregate;
 
 use ArrayIterator;
 use Countable;
@@ -20,6 +20,7 @@ use Predis\Cluster\StrategyInterface as ClusterStrategyInterface;
 use Predis\Cluster\Distributor\DistributorInterface;
 use Predis\Cluster\Distributor\HashRing;
 use Predis\Command\CommandInterface;
+use Predis\Connection\NodeConnectionInterface;
 
 /**
  * Abstraction for a cluster of aggregate connections to various Redis servers
@@ -28,7 +29,7 @@ use Predis\Command\CommandInterface;
  * @author Daniele Alessandri <suppakilla@gmail.com>
  * @todo Add the ability to remove connections from pool.
  */
-class PredisCluster implements ClusterConnectionInterface, IteratorAggregate, Countable
+class PredisCluster implements ClusterInterface, IteratorAggregate, Countable
 {
     private $pool;
     private $strategy;
@@ -83,7 +84,7 @@ class PredisCluster implements ClusterConnectionInterface, IteratorAggregate, Co
     /**
      * {@inheritdoc}
      */
-    public function add(SingleConnectionInterface $connection)
+    public function add(NodeConnectionInterface $connection)
     {
         $parameters = $connection->getParameters();
 
@@ -100,7 +101,7 @@ class PredisCluster implements ClusterConnectionInterface, IteratorAggregate, Co
     /**
      * {@inheritdoc}
      */
-    public function remove(SingleConnectionInterface $connection)
+    public function remove(NodeConnectionInterface $connection)
     {
         if (($id = array_search($connection, $this->pool, true)) !== false) {
             unset($this->pool[$id]);
@@ -156,8 +157,8 @@ class PredisCluster implements ClusterConnectionInterface, IteratorAggregate, Co
     /**
      * Retrieves a connection instance from the cluster using a key.
      *
-     * @param  string                    $key Key string.
-     * @return SingleConnectionInterface
+     * @param  string                  $key Key string.
+     * @return NodeConnectionInterface
      */
     public function getConnectionByKey($key)
     {

+ 18 - 15
lib/Predis/Connection/RedisCluster.php → lib/Predis/Connection/Aggregate/RedisCluster.php

@@ -9,7 +9,7 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection;
+namespace Predis\Connection\Aggregate;
 
 use ArrayIterator;
 use Countable;
@@ -19,6 +19,9 @@ use Predis\NotSupportedException;
 use Predis\Cluster\RedisStrategy as RedisClusterStrategy;
 use Predis\Command\CommandInterface;
 use Predis\Command\RawCommand;
+use Predis\Connection\NodeConnectionInterface;
+use Predis\Connection\Factory;
+use Predis\Connection\FactoryInterface;
 use Predis\Response\ErrorInterface as ErrorResponseInterface;
 
 /**
@@ -43,7 +46,7 @@ use Predis\Response\ErrorInterface as ErrorResponseInterface;
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class RedisCluster implements ClusterConnectionInterface, IteratorAggregate, Countable
+class RedisCluster implements ClusterInterface, IteratorAggregate, Countable
 {
     private $askClusterNodes = false;
     private $defaultParameters = array();
@@ -99,7 +102,7 @@ class RedisCluster implements ClusterConnectionInterface, IteratorAggregate, Cou
     /**
      * {@inheritdoc}
      */
-    public function add(SingleConnectionInterface $connection)
+    public function add(NodeConnectionInterface $connection)
     {
         $this->pool[(string) $connection] = $connection;
         unset($this->slotsMap);
@@ -108,7 +111,7 @@ class RedisCluster implements ClusterConnectionInterface, IteratorAggregate, Cou
     /**
      * {@inheritdoc}
      */
-    public function remove(SingleConnectionInterface $connection)
+    public function remove(NodeConnectionInterface $connection)
     {
         if (false !== $id = array_search($connection, $this->pool, true)) {
             unset(
@@ -212,9 +215,9 @@ class RedisCluster implements ClusterConnectionInterface, IteratorAggregate, Cou
     /**
      * Pre-associates a connection to a slots range to avoid runtime guessing.
      *
-     * @param int                              $first      Initial slot of the range.
-     * @param int                              $last       Last slot of the range.
-     * @param SingleConnectionInterface|string $connection ID or connection instance.
+     * @param int                            $first      Initial slot of the range.
+     * @param int                            $last       Last slot of the range.
+     * @param NodeConnectionInterface|string $connection ID or connection instance.
      */
     public function setSlots($first, $last, $connection)
     {
@@ -259,8 +262,8 @@ class RedisCluster implements ClusterConnectionInterface, IteratorAggregate, Cou
     /**
      * Creates a new connection instance from the given connection ID.
      *
-     * @param  string                    $connectionID Identifier for the connection.
-     * @return SingleConnectionInterface
+     * @param  string                  $connectionID Identifier for the connection.
+     * @return NodeConnectionInterface
      */
     protected function createConnection($connectionID)
     {
@@ -301,8 +304,8 @@ class RedisCluster implements ClusterConnectionInterface, IteratorAggregate, Cou
     /**
      * Returns the connection currently associated to a given slot.
      *
-     * @param  int                       $slot Slot index.
-     * @return SingleConnectionInterface
+     * @param  int                     $slot Slot index.
+     * @return NodeConnectionInterface
      */
     public function getConnectionBySlot($slot)
     {
@@ -337,7 +340,7 @@ class RedisCluster implements ClusterConnectionInterface, IteratorAggregate, Cou
     /**
      * Returns a random connection from the pool.
      *
-     * @return SingleConnectionInterface
+     * @return NodeConnectionInterface
      */
     protected function getRandomConnection()
     {
@@ -350,10 +353,10 @@ class RedisCluster implements ClusterConnectionInterface, IteratorAggregate, Cou
      * Permanently associates the connection instance to a new slot.
      * The connection is added to the connections pool if not yet included.
      *
-     * @param SingleConnectionInterface $connection Connection instance.
-     * @param int                       $slot       Target slot index.
+     * @param NodeConnectionInterface $connection Connection instance.
+     * @param int                     $slot       Target slot index.
      */
-    protected function move(SingleConnectionInterface $connection, $slot)
+    protected function move(NodeConnectionInterface $connection, $slot)
     {
         $this->pool[(string) $connection] = $connection;
         $this->slots[(int) $slot] = $connection;

+ 7 - 5
lib/Predis/Connection/ReplicationConnectionInterface.php → lib/Predis/Connection/Aggregate/ReplicationInterface.php

@@ -9,14 +9,16 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection;
+namespace Predis\Connection\Aggregate;
+
+use Predis\Connection\AggregateConnectionInterface;
 
 /**
  * Defines a group of Redis nodes in a master / slave replication setup.
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-interface ReplicationConnectionInterface extends AggregateConnectionInterface
+interface ReplicationInterface extends AggregateConnectionInterface
 {
     /**
      * Switches the internal connection instance in use.
@@ -29,21 +31,21 @@ interface ReplicationConnectionInterface extends AggregateConnectionInterface
      * Returns the connection instance currently in use by the aggregate
      * connection.
      *
-     * @return SingleConnectionInterface
+     * @return Predis\Connection\NodeConnectionInterface
      */
     public function getCurrent();
 
     /**
      * Returns the connection instance for the master Redis node.
      *
-     * @return SingleConnectionInterface
+     * @return Predis\Connection\NodeConnectionInterface
      */
     public function getMaster();
 
     /**
      * Returns a list of connection instances to slave nodes.
      *
-     * @return SingleConnectionInterface
+     * @return Predis\Connection\NodeConnectionInterface
      */
     public function getSlaves();
 }

+ 9 - 9
lib/Predis/Connection/AggregateConnectionInterface.php

@@ -24,31 +24,31 @@ interface AggregateConnectionInterface extends ConnectionInterface
     /**
      * Adds a connection instance to the aggregate connection.
      *
-     * @param SingleConnectionInterface $connection Connection instance.
+     * @param NodeConnectionInterface $connection Connection instance.
      */
-    public function add(SingleConnectionInterface $connection);
+    public function add(NodeConnectionInterface $connection);
 
     /**
      * Removes the specified connection instance from the aggregate connection.
      *
-     * @param  SingleConnectionInterface $connection Connection instance.
-     * @return bool                      Returns true if the connection was in the pool.
+     * @param  NodeConnectionInterface $connection Connection instance.
+     * @return bool                    Returns true if the connection was in the pool.
      */
-    public function remove(SingleConnectionInterface $connection);
+    public function remove(NodeConnectionInterface $connection);
 
     /**
      * Returns the connection instance in charge for the given command.
      *
-     * @param  CommandInterface          $command Command instance.
-     * @return SingleConnectionInterface
+     * @param  CommandInterface        $command Command instance.
+     * @return NodeConnectionInterface
      */
     public function getConnection(CommandInterface $command);
 
     /**
      * Returns a connection instance from the aggregate connection by its alias.
      *
-     * @param  string                    $connectionID Connection alias.
-     * @return SingleConnectionInterface
+     * @param  string                  $connectionID Connection alias.
+     * @return NodeConnectionInterface
      */
     public function getConnectionById($connectionID);
 }

+ 1 - 1
lib/Predis/Connection/ComposableConnectionInterface.php → lib/Predis/Connection/CompositeConnectionInterface.php

@@ -17,7 +17,7 @@ namespace Predis\Connection;
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-interface ComposableConnectionInterface extends SingleConnectionInterface
+interface CompositeConnectionInterface extends NodeConnectionInterface
 {
     /**
      * Returns the protocol processor used by the connection.

+ 1 - 1
lib/Predis/Connection/ComposableStreamConnection.php → lib/Predis/Connection/CompositeStreamConnection.php

@@ -22,7 +22,7 @@ use Predis\Protocol\Text\ProtocolProcessor as TextProtocolProcessor;
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ComposableStreamConnection extends StreamConnection implements ComposableConnectionInterface
+class CompositeStreamConnection extends StreamConnection implements CompositeConnectionInterface
 {
     protected $protocol;
 

+ 7 - 7
lib/Predis/Connection/Factory.php

@@ -31,7 +31,7 @@ class Factory implements FactoryInterface
 
     /**
      * Checks if the provided argument represents a valid connection class
-     * implementing Predis\Connection\SingleConnectionInterface. Optionally,
+     * implementing Predis\Connection\NodeConnectionInterface. Optionally,
      * callable objects are used for lazy initialization of connection objects.
      *
      * @param  mixed $initializer FQN of a connection class or a callable for lazy initialization.
@@ -45,7 +45,7 @@ class Factory implements FactoryInterface
 
         $class = new ReflectionClass($initializer);
 
-        if (!$class->isSubclassOf('Predis\Connection\SingleConnectionInterface')) {
+        if (!$class->isSubclassOf('Predis\Connection\NodeConnectionInterface')) {
             throw new InvalidArgumentException(
                 'A connection initializer must be a valid connection class or a callable object.'
             );
@@ -94,10 +94,10 @@ class Factory implements FactoryInterface
             $this->prepareConnection($connection);
         }
 
-        if (!$connection instanceof SingleConnectionInterface) {
+        if (!$connection instanceof NodeConnectionInterface) {
             throw new UnexpectedValueException(
                 "Objects returned by connection initializers must implement ".
-                "'Predis\Connection\SingleConnectionInterface'."
+                "'Predis\Connection\NodeConnectionInterface'."
             );
         }
 
@@ -110,16 +110,16 @@ class Factory implements FactoryInterface
     public function aggregate(AggregateConnectionInterface $connection, array $parameters)
     {
         foreach ($parameters as $node) {
-            $connection->add($node instanceof SingleConnectionInterface ? $node : $this->create($node));
+            $connection->add($node instanceof NodeConnectionInterface ? $node : $this->create($node));
         }
     }
 
     /**
      * Prepares a connection instance after its initialization.
      *
-     * @param SingleConnectionInterface $connection Connection instance.
+     * @param NodeConnectionInterface $connection Connection instance.
      */
-    protected function prepareConnection(SingleConnectionInterface $connection)
+    protected function prepareConnection(NodeConnectionInterface $connection)
     {
         $parameters = $connection->getParameters();
 

+ 2 - 2
lib/Predis/Connection/FactoryInterface.php

@@ -36,8 +36,8 @@ interface FactoryInterface
     /**
      * Creates a new connection object.
      *
-     * @param  mixed                     $parameters Initialization parameters for the connection.
-     * @return SingleConnectionInterface
+     * @param  mixed                   $parameters Initialization parameters for the connection.
+     * @return NodeConnectionInterface
      */
     public function create($parameters);
 

+ 1 - 1
lib/Predis/Connection/SingleConnectionInterface.php → lib/Predis/Connection/NodeConnectionInterface.php

@@ -18,7 +18,7 @@ use Predis\Command\CommandInterface;
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-interface SingleConnectionInterface extends ConnectionInterface
+interface NodeConnectionInterface extends ConnectionInterface
 {
     /**
      * Returns a string representation of the connection.

+ 1 - 1
lib/Predis/Connection/WebdisConnection.php

@@ -44,7 +44,7 @@ use Predis\Response\Status as StatusResponse;
  * @link http://github.com/seppo0010/phpiredis
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class WebdisConnection implements SingleConnectionInterface
+class WebdisConnection implements NodeConnectionInterface
 {
     private $parameters;
     private $resource;

+ 2 - 2
lib/Predis/Pipeline/Atomic.php

@@ -15,7 +15,7 @@ use SplQueue;
 use Predis\ClientException;
 use Predis\ClientInterface;
 use Predis\Connection\ConnectionInterface;
-use Predis\Connection\SingleConnectionInterface;
+use Predis\Connection\NodeConnectionInterface;
 use Predis\Response\ErrorInterface as ErrorResponseInterface;
 use Predis\Response\ResponseInterface;
 use Predis\Response\ServerException;
@@ -48,7 +48,7 @@ class Atomic extends Pipeline
     {
         $connection = $this->getClient()->getConnection();
 
-        if (!$connection instanceof SingleConnectionInterface) {
+        if (!$connection instanceof NodeConnectionInterface) {
             $class = __CLASS__;
 
             throw new ClientException("The class '$class' does not support aggregate connections.");

+ 6 - 6
lib/Predis/Pipeline/ConnectionErrorProof.php

@@ -14,9 +14,9 @@ namespace Predis\Pipeline;
 use SplQueue;
 use Predis\NotSupportedException;
 use Predis\CommunicationException;
-use Predis\Connection\ClusterConnectionInterface;
+use Predis\Connection\ClusterInterface;
 use Predis\Connection\ConnectionInterface;
-use Predis\Connection\SingleConnectionInterface;
+use Predis\Connection\NodeConnectionInterface;
 
 /**
  * Command pipeline that does not throw exceptions on connection errors, but
@@ -40,9 +40,9 @@ class ConnectionErrorProof extends Pipeline
      */
     protected function executePipeline(ConnectionInterface $connection, SplQueue $commands)
     {
-        if ($connection instanceof SingleConnectionInterface) {
+        if ($connection instanceof NodeConnectionInterface) {
             return $this->executeSingleNode($connection, $commands);
-        } elseif ($connection instanceof ClusterConnectionInterface) {
+        } elseif ($connection instanceof ClusterInterface) {
             return $this->executeCluster($connection, $commands);
         } else {
             $class = get_class($connection);
@@ -54,7 +54,7 @@ class ConnectionErrorProof extends Pipeline
     /**
      * {@inheritdoc}
      */
-    public function executeSingleNode(SingleConnectionInterface $connection, SplQueue $commands)
+    public function executeSingleNode(NodeConnectionInterface $connection, SplQueue $commands)
     {
         $responses  = array();
         $sizeOfPipe = count($commands);
@@ -86,7 +86,7 @@ class ConnectionErrorProof extends Pipeline
     /**
      * {@inheritdoc}
      */
-    public function executeCluster(ClusterConnectionInterface $connection, SplQueue $commands)
+    public function executeCluster(ClusterInterface $connection, SplQueue $commands)
     {
         $responses = array();
         $sizeOfPipe = count($commands);

+ 2 - 2
lib/Predis/Pipeline/Pipeline.php

@@ -20,7 +20,7 @@ use Predis\ClientInterface;
 use Predis\ExecutableContextInterface;
 use Predis\Command\CommandInterface;
 use Predis\Connection\ConnectionInterface;
-use Predis\Connection\ReplicationConnectionInterface;
+use Predis\Connection\Aggregate\ReplicationInterface;
 use Predis\Response\ErrorInterface as ErrorResponseInterface;
 use Predis\Response\ResponseInterface;
 use Predis\Response\ServerException;
@@ -109,7 +109,7 @@ class Pipeline implements BasicClientInterface, ExecutableContextInterface
     {
         $connection = $this->getClient()->getConnection();
 
-        if ($connection instanceof ReplicationConnectionInterface) {
+        if ($connection instanceof ReplicationInterface) {
             $connection->switchTo('master');
         }
 

+ 6 - 6
lib/Predis/Protocol/ProtocolProcessorInterface.php

@@ -12,7 +12,7 @@
 namespace Predis\Protocol;
 
 use Predis\Command\CommandInterface;
-use Predis\Connection\ComposableConnectionInterface;
+use Predis\Connection\CompositeConnectionInterface;
 
 /**
  * Defines a pluggable protocol processor capable of serializing commands and
@@ -25,16 +25,16 @@ interface ProtocolProcessorInterface
     /**
      * Writes a request over a connection to Redis.
      *
-     * @param ComposableConnectionInterface $connection Redis connection.
-     * @param CommandInterface              $command    Command instance.
+     * @param CompositeConnectionInterface $connection Redis connection.
+     * @param CommandInterface             $command    Command instance.
      */
-    public function write(ComposableConnectionInterface $connection, CommandInterface $command);
+    public function write(CompositeConnectionInterface $connection, CommandInterface $command);
 
     /**
      * Reads a response from a connection to Redis.
      *
-     * @param  ComposableConnectionInterface $connection Redis connection.
+     * @param  CompositeConnectionInterface $connection Redis connection.
      * @return mixed
      */
-    public function read(ComposableConnectionInterface $connection);
+    public function read(CompositeConnectionInterface $connection);
 }

+ 3 - 3
lib/Predis/Protocol/ResponseReaderInterface.php

@@ -11,7 +11,7 @@
 
 namespace Predis\Protocol;
 
-use Predis\Connection\ComposableConnectionInterface;
+use Predis\Connection\CompositeConnectionInterface;
 
 /**
  * Defines a pluggable reader capable of parsing responses returned by Redis and
@@ -24,8 +24,8 @@ interface ResponseReaderInterface
     /**
      * Reads a response from a connection to Redis.
      *
-     * @param  ComposableConnectionInterface $connection Redis connection.
+     * @param  CompositeConnectionInterface $connection Redis connection.
      * @return mixed
      */
-    public function read(ComposableConnectionInterface $connection);
+    public function read(CompositeConnectionInterface $connection);
 }

+ 5 - 5
lib/Predis/Protocol/Text/ComposableProtocolProcessor.php → lib/Predis/Protocol/Text/CompositeProtocolProcessor.php

@@ -12,19 +12,19 @@
 namespace Predis\Protocol\Text;
 
 use Predis\Command\CommandInterface;
-use Predis\Connection\ComposableConnectionInterface;
+use Predis\Connection\CompositeConnectionInterface;
 use Predis\Protocol\ProtocolProcessorInterface;
 use Predis\Protocol\RequestSerializerInterface;
 use Predis\Protocol\ResponseReaderInterface;
 
 /**
- * Composable protocol processor for the standard Redis wire protocol using
+ * Composite protocol processor for the standard Redis wire protocol using
  * pluggable handlers to serialize requests and deserialize responses.
  *
  * @link http://redis.io/topics/protocol
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ComposableProtocolProcessor implements ProtocolProcessorInterface
+class CompositeProtocolProcessor implements ProtocolProcessorInterface
 {
     protected $serializer;
     protected $reader;
@@ -44,7 +44,7 @@ class ComposableProtocolProcessor implements ProtocolProcessorInterface
     /**
      * {@inheritdoc}
      */
-    public function write(ComposableConnectionInterface $connection, CommandInterface $command)
+    public function write(CompositeConnectionInterface $connection, CommandInterface $command)
     {
         $connection->writeBuffer($this->serializer->serialize($command));
     }
@@ -52,7 +52,7 @@ class ComposableProtocolProcessor implements ProtocolProcessorInterface
     /**
      * {@inheritdoc}
      */
-    public function read(ComposableConnectionInterface $connection)
+    public function read(CompositeConnectionInterface $connection)
     {
         return $this->reader->read($connection);
     }

+ 2 - 2
lib/Predis/Protocol/Text/Handler/BulkResponse.php

@@ -12,7 +12,7 @@
 namespace Predis\Protocol\Text\Handler;
 
 use Predis\CommunicationException;
-use Predis\Connection\ComposableConnectionInterface;
+use Predis\Connection\CompositeConnectionInterface;
 use Predis\Protocol\ProtocolException;
 
 /**
@@ -27,7 +27,7 @@ class BulkResponse implements ResponseHandlerInterface
     /**
      * {@inheritdoc}
      */
-    public function handle(ComposableConnectionInterface $connection, $payload)
+    public function handle(CompositeConnectionInterface $connection, $payload)
     {
         $length = (int) $payload;
 

+ 2 - 2
lib/Predis/Protocol/Text/Handler/ErrorResponse.php

@@ -11,7 +11,7 @@
 
 namespace Predis\Protocol\Text\Handler;
 
-use Predis\Connection\ComposableConnectionInterface;
+use Predis\Connection\CompositeConnectionInterface;
 use Predis\Response\Error;
 
 /**
@@ -26,7 +26,7 @@ class ErrorResponse implements ResponseHandlerInterface
     /**
      * {@inheritdoc}
      */
-    public function handle(ComposableConnectionInterface $connection, $payload)
+    public function handle(CompositeConnectionInterface $connection, $payload)
     {
         return new Error($payload);
     }

+ 2 - 2
lib/Predis/Protocol/Text/Handler/IntegerResponse.php

@@ -12,7 +12,7 @@
 namespace Predis\Protocol\Text\Handler;
 
 use Predis\CommunicationException;
-use Predis\Connection\ComposableConnectionInterface;
+use Predis\Connection\CompositeConnectionInterface;
 use Predis\Protocol\ProtocolException;
 
 /**
@@ -27,7 +27,7 @@ class IntegerResponse implements ResponseHandlerInterface
     /**
      * {@inheritdoc}
      */
-    public function handle(ComposableConnectionInterface $connection, $payload)
+    public function handle(CompositeConnectionInterface $connection, $payload)
     {
         if (is_numeric($payload)) {
             return (int) $payload;

+ 2 - 2
lib/Predis/Protocol/Text/Handler/MultiBulkResponse.php

@@ -12,7 +12,7 @@
 namespace Predis\Protocol\Text\Handler;
 
 use Predis\CommunicationException;
-use Predis\Connection\ComposableConnectionInterface;
+use Predis\Connection\CompositeConnectionInterface;
 use Predis\Protocol\ProtocolException;
 
 /**
@@ -27,7 +27,7 @@ class MultiBulkResponse implements ResponseHandlerInterface
     /**
      * {@inheritdoc}
      */
-    public function handle(ComposableConnectionInterface $connection, $payload)
+    public function handle(CompositeConnectionInterface $connection, $payload)
     {
         $length = (int) $payload;
 

+ 4 - 4
lib/Predis/Protocol/Text/Handler/ResponseHandlerInterface.php

@@ -11,7 +11,7 @@
 
 namespace Predis\Protocol\Text\Handler;
 
-use Predis\Connection\ComposableConnectionInterface;
+use Predis\Connection\CompositeConnectionInterface;
 
 /**
  * Defines a pluggable handler used to parse a particular type of response.
@@ -24,9 +24,9 @@ interface ResponseHandlerInterface
      * Deserializes a response returned by Redis and reads more data from the
      * connection if needed.
      *
-     * @param  ComposableConnectionInterface $connection Redis connection.
-     * @param  string                        $payload    String payload.
+     * @param  CompositeConnectionInterface $connection Redis connection.
+     * @param  string                       $payload    String payload.
      * @return mixed
      */
-    public function handle(ComposableConnectionInterface $connection, $payload);
+    public function handle(CompositeConnectionInterface $connection, $payload);
 }

+ 2 - 2
lib/Predis/Protocol/Text/Handler/StatusResponse.php

@@ -11,7 +11,7 @@
 
 namespace Predis\Protocol\Text\Handler;
 
-use Predis\Connection\ComposableConnectionInterface;
+use Predis\Connection\CompositeConnectionInterface;
 use Predis\Response\Status;
 
 /**
@@ -27,7 +27,7 @@ class StatusResponse implements ResponseHandlerInterface
     /**
      * {@inheritdoc}
      */
-    public function handle(ComposableConnectionInterface $connection, $payload)
+    public function handle(CompositeConnectionInterface $connection, $payload)
     {
         return Status::get($payload);
     }

+ 2 - 2
lib/Predis/Protocol/Text/Handler/StreamableMultiBulkResponse.php

@@ -12,7 +12,7 @@
 namespace Predis\Protocol\Text\Handler;
 
 use Predis\CommunicationException;
-use Predis\Connection\ComposableConnectionInterface;
+use Predis\Connection\CompositeConnectionInterface;
 use Predis\Response\Iterator\MultiBulk as MultiBulkIterator;
 use Predis\Protocol\ProtocolException;
 
@@ -31,7 +31,7 @@ class StreamableMultiBulkResponse implements ResponseHandlerInterface
     /**
      * {@inheritdoc}
      */
-    public function handle(ComposableConnectionInterface $connection, $payload)
+    public function handle(CompositeConnectionInterface $connection, $payload)
     {
         $length = (int) $payload;
 

+ 3 - 3
lib/Predis/Protocol/Text/ProtocolProcessor.php

@@ -13,7 +13,7 @@ namespace Predis\Protocol\Text;
 
 use Predis\CommunicationException;
 use Predis\Command\CommandInterface;
-use Predis\Connection\ComposableConnectionInterface;
+use Predis\Connection\CompositeConnectionInterface;
 use Predis\Protocol\ProtocolException;
 use Predis\Protocol\ProtocolProcessorInterface;
 use Predis\Response\Status as StatusResponse;
@@ -43,7 +43,7 @@ class ProtocolProcessor implements ProtocolProcessorInterface
     /**
      * {@inheritdoc}
      */
-    public function write(ComposableConnectionInterface $connection, CommandInterface $command)
+    public function write(CompositeConnectionInterface $connection, CommandInterface $command)
     {
         $request = $this->serializer->serialize($command);
         $connection->writeBuffer($request);
@@ -52,7 +52,7 @@ class ProtocolProcessor implements ProtocolProcessorInterface
     /**
      * {@inheritdoc}
      */
-    public function read(ComposableConnectionInterface $connection)
+    public function read(CompositeConnectionInterface $connection)
     {
         $chunk = $connection->readLine();
         $prefix = $chunk[0];

+ 5 - 5
lib/Predis/Protocol/Text/ResponseReader.php

@@ -12,7 +12,7 @@
 namespace Predis\Protocol\Text;
 
 use Predis\CommunicationException;
-use Predis\Connection\ComposableConnectionInterface;
+use Predis\Connection\CompositeConnectionInterface;
 use Predis\Protocol\ProtocolException;
 use Predis\Protocol\ResponseReaderInterface;
 
@@ -77,7 +77,7 @@ class ResponseReader implements ResponseReaderInterface
     /**
      * {@inheritdoc}
      */
-    public function read(ComposableConnectionInterface $connection)
+    public function read(CompositeConnectionInterface $connection)
     {
         $header = $connection->readLine();
 
@@ -100,10 +100,10 @@ class ResponseReader implements ResponseReaderInterface
      * Handles protocol errors generated while reading responses from a
      * connection.
      *
-     * @param ComposableConnectionInterface $connection Redis connection that generated the error.
-     * @param string                        $message    Error message.
+     * @param CompositeConnectionInterface $connection Redis connection that generated the error.
+     * @param string                       $message    Error message.
      */
-    protected function onProtocolError(ComposableConnectionInterface $connection, $message)
+    protected function onProtocolError(CompositeConnectionInterface $connection, $message)
     {
         CommunicationException::handle(
             new ProtocolException($connection, $message)

+ 4 - 4
lib/Predis/Response/Iterator/MultiBulk.php

@@ -11,7 +11,7 @@
 
 namespace Predis\Response\Iterator;
 
-use Predis\Connection\SingleConnectionInterface;
+use Predis\Connection\NodeConnectionInterface;
 
 /**
  * Streamable multibulk response.
@@ -23,10 +23,10 @@ class MultiBulk extends MultiBulkIterator
     private $connection;
 
     /**
-     * @param SingleConnectionInterface $connection Connection to Redis.
-     * @param int                       $size       Number of elements of the multibulk response.
+     * @param NodeConnectionInterface $connection Connection to Redis.
+     * @param int                     $size       Number of elements of the multibulk response.
      */
-    public function __construct(SingleConnectionInterface $connection, $size)
+    public function __construct(NodeConnectionInterface $connection, $size)
     {
         $this->connection = $connection;
         $this->size = $size;

+ 1 - 1
lib/Predis/Transaction/MultiExec.php

@@ -424,7 +424,7 @@ class MultiExec implements BasicClientInterface, ExecutableContextInterface
     {
         // Since a MULTI/EXEC block cannot be initialized when using aggregate
         // connections we can safely assume that Predis\Client::getConnection()
-        // will return a Predis\Connection\SingleConnectionInterface instance.
+        // will return a Predis\Connection\NodeConnectionInterface instance.
         CommunicationException::handle(new ProtocolException(
             $this->client->getConnection(), $message
         ));

+ 25 - 25
tests/Predis/ClientTest.php

@@ -30,7 +30,7 @@ class ClientTest extends PredisTestCase
         $client = new Client();
 
         $connection = $client->getConnection();
-        $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $connection);
+        $this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $connection);
 
         $parameters = $connection->getParameters();
         $this->assertSame($parameters->host, '127.0.0.1');
@@ -50,7 +50,7 @@ class ClientTest extends PredisTestCase
         $client = new Client(null);
 
         $connection = $client->getConnection();
-        $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $connection);
+        $this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $connection);
 
         $parameters = $connection->getParameters();
         $this->assertSame($parameters->host, '127.0.0.1');
@@ -70,7 +70,7 @@ class ClientTest extends PredisTestCase
         $client = new Client(null, null);
 
         $connection = $client->getConnection();
-        $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $connection);
+        $this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $connection);
 
         $parameters = $connection->getParameters();
         $this->assertSame($parameters->host, '127.0.0.1');
@@ -106,7 +106,7 @@ class ClientTest extends PredisTestCase
 
         $client = new Client($arg1);
 
-        $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $client->getConnection());
+        $this->assertInstanceOf('Predis\Connection\Aggregate\ClusterInterface', $client->getConnection());
     }
 
     /**
@@ -128,7 +128,7 @@ class ClientTest extends PredisTestCase
     {
         $client = new Client($arg1 = array('tcp://localhost:7000', 'tcp://localhost:7001'));
 
-        $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $client->getConnection());
+        $this->assertInstanceOf('Predis\Connection\Aggregate\ClusterInterface', $client->getConnection());
     }
 
     /**
@@ -136,12 +136,12 @@ class ClientTest extends PredisTestCase
      */
     public function testConstructorWithArrayOfConnectionsArgument()
     {
-        $connection1 = $this->getMock('Predis\Connection\SingleConnectionInterface');
-        $connection2 = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection1 = $this->getMock('Predis\Connection\NodeConnectionInterface');
+        $connection2 = $this->getMock('Predis\Connection\NodeConnectionInterface');
 
         $client = new Client(array($connection1, $connection2));
 
-        $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $cluster = $client->getConnection());
+        $this->assertInstanceOf('Predis\Connection\Aggregate\ClusterInterface', $cluster = $client->getConnection());
         $this->assertSame($connection1, $cluster->getConnectionById(0));
         $this->assertSame($connection2, $cluster->getConnectionById(1));
     }
@@ -156,7 +156,7 @@ class ClientTest extends PredisTestCase
 
         $client = new Client($connection);
 
-        $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $client->getConnection());
+        $this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $client->getConnection());
         $this->assertSame($connection, $client->getConnection());
 
         $parameters = $client->getConnection()->getParameters();
@@ -169,14 +169,14 @@ class ClientTest extends PredisTestCase
      */
     public function testConstructorWithClusterArgument()
     {
-        $cluster = new Connection\PredisCluster();
+        $cluster = new Connection\Aggregate\PredisCluster();
 
         $factory = new Connection\Factory();
         $factory->aggregate($cluster, array('tcp://localhost:7000', 'tcp://localhost:7001'));
 
         $client = new Client($cluster);
 
-        $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $client->getConnection());
+        $this->assertInstanceOf('Predis\Connection\Aggregate\ClusterInterface', $client->getConnection());
         $this->assertSame($cluster, $client->getConnection());
     }
 
@@ -185,14 +185,14 @@ class ClientTest extends PredisTestCase
      */
     public function testConstructorWithReplicationArgument()
     {
-        $replication = new Connection\MasterSlaveReplication();
+        $replication = new Connection\Aggregate\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\ReplicationConnectionInterface', $client->getConnection());
+        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $client->getConnection());
         $this->assertSame($replication, $client->getConnection());
     }
 
@@ -257,7 +257,7 @@ class ClientTest extends PredisTestCase
         $arg2 = array('replication' => true);
         $client = new Client($arg1, $arg2);
 
-        $this->assertInstanceOf('Predis\Connection\ReplicationConnectionInterface', $connection = $client->getConnection());
+        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $connection = $client->getConnection());
         $this->assertSame('host1', $connection->getConnectionById('master')->getParameters()->host);
         $this->assertSame('host2', $connection->getConnectionById('slave')->getParameters()->host);
     }
@@ -584,9 +584,9 @@ class ClientTest extends PredisTestCase
     {
         $client = new Client(array('tcp://host1?alias=node01', 'tcp://host2?alias=node02'));
 
-        $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $cluster = $client->getConnection());
-        $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $node01 = $client->getConnectionById('node01'));
-        $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $node02 = $client->getConnectionById('node02'));
+        $this->assertInstanceOf('Predis\Connection\Aggregate\ClusterInterface', $cluster = $client->getConnection());
+        $this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $node01 = $client->getConnectionById('node01'));
+        $this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $node02 = $client->getConnectionById('node02'));
 
         $this->assertSame('host1', $node01->getParameters()->host);
         $this->assertSame('host2', $node02->getParameters()->host);
@@ -611,9 +611,9 @@ class ClientTest extends PredisTestCase
     {
         $client = new Client(array('tcp://host1?alias=node01', 'tcp://host2?alias=node02'), array('prefix' => 'pfx:'));
 
-        $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $cluster = $client->getConnection());
-        $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $node01 = $client->getConnectionById('node01'));
-        $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $node02 = $client->getConnectionById('node02'));
+        $this->assertInstanceOf('Predis\Connection\Aggregate\ClusterInterface', $cluster = $client->getConnection());
+        $this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $node01 = $client->getConnectionById('node01'));
+        $this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $node02 = $client->getConnectionById('node02'));
 
         $clientNode02 = $client->getClientFor('node02');
 
@@ -684,7 +684,7 @@ class ClientTest extends PredisTestCase
      */
     public function testPubSubLoopWithArrayReturnsPubSubConsumerWithOptions()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $options = array('subscribe' => 'channel');
 
         $client = new Client($connection);
@@ -709,7 +709,7 @@ class ClientTest extends PredisTestCase
         $message = array('subscribe', 'channel', 0);
         $options = array('subscribe' => 'channel');
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->once())
                    ->method('read')
                    ->will($this->returnValue($message));
@@ -762,7 +762,7 @@ class ClientTest extends PredisTestCase
         //       here is not the point.
         $options = array('cas' => true, 'retry' => 3);
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->once())
                    ->method('executeCommand')
                    ->will($this->returnValue(new Response\Status('QUEUED')));
@@ -785,7 +785,7 @@ class ClientTest extends PredisTestCase
      */
     public function testMonitorReturnsMonitorConsumer()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $client = new Client($connection);
 
         $this->assertInstanceOf('Predis\Monitor\Consumer', $monitor = $client->monitor());
@@ -805,7 +805,7 @@ class ClientTest extends PredisTestCase
                 ->with('OK')
                 ->will($this->returnValue(true));
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->at(0))
                    ->method('executeCommand')
                    ->with($command)

+ 8 - 8
tests/Predis/CommunicationExceptionTest.php

@@ -62,7 +62,7 @@ class CommunicationExceptionTest extends PredisTestCase
      */
     public function testCommunicationExceptionHandling()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->once())->method('isConnected')->will($this->returnValue(true));
         $connection->expects($this->once())->method('disconnect');
 
@@ -78,8 +78,8 @@ class CommunicationExceptionTest extends PredisTestCase
     /**
      * Returns a mocked connection instance.
      *
-     * @param  mixed                                $parameters Connection parameters.
-     * @return Connection\SingleConnectionInterface
+     * @param  mixed                              $parameters Connection parameters.
+     * @return Connection\NodeConnectionInterface
      */
     protected function getMockedConnectionBase($parameters = null)
     {
@@ -97,14 +97,14 @@ class CommunicationExceptionTest extends PredisTestCase
     /**
      * Returns a connection exception instance.
      *
-     * @param  Connection\SingleConnectionInterface $connection Connection instance.
-     * @param  string                               $message    Exception message.
-     * @param  int                                  $code       Exception code.
-     * @param  \Exception                           $inner      Inner exception.
+     * @param  Connection\NodeConnectionInterface $connection Connection instance.
+     * @param  string                             $message    Exception message.
+     * @param  int                                $code       Exception code.
+     * @param  \Exception                         $inner      Inner exception.
      * @return \Exception
      */
     protected function getException(
-        Connection\SingleConnectionInterface $connection,
+        Connection\NodeConnectionInterface $connection,
         $message,
         $code = 0,
         \Exception $inner = null

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

@@ -26,17 +26,17 @@ class ClusterOptionTest extends PredisTestCase
         $option = new ClusterOption();
         $options = $this->getMock('Predis\Configuration\OptionsInterface');
 
-        $this->assertInstanceOf('Predis\Connection\PredisCluster', $option->getDefault($options));
+        $this->assertInstanceOf('Predis\Connection\Aggregate\PredisCluster', $option->getDefault($options));
     }
 
     /**
      * @group disconnected
      */
-    public function testAcceptsInstanceOfClusterConnectionInterface()
+    public function testAcceptsInstanceOfClusterInterface()
     {
         $option = new ClusterOption();
         $options = $this->getMock('Predis\Configuration\OptionsInterface');
-        $cluster = $this->getMock('Predis\Connection\ClusterConnectionInterface');
+        $cluster = $this->getMock('Predis\Connection\Aggregate\ClusterInterface');
 
         $this->assertSame($cluster, $option->filter($options, $cluster));
     }
@@ -49,11 +49,11 @@ class ClusterOptionTest extends PredisTestCase
         $option = new ClusterOption();
         $options = $this->getMock('Predis\Configuration\OptionsInterface');
 
-        $this->assertInstanceOf('Predis\Connection\PredisCluster', $option->filter($options, 'predis'));
-        $this->assertInstanceOf('Predis\Connection\PredisCluster', $option->filter($options, 'predis-cluster'));
+        $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\RedisCluster', $option->filter($options, 'redis'));
-        $this->assertInstanceOf('Predis\Connection\RedisCluster', $option->filter($options, 'redis-cluster'));
+        $this->assertInstanceOf('Predis\Connection\Aggregate\RedisCluster', $option->filter($options, 'redis'));
+        $this->assertInstanceOf('Predis\Connection\Aggregate\RedisCluster', $option->filter($options, 'redis-cluster'));
     }
 
     /**
@@ -64,7 +64,7 @@ class ClusterOptionTest extends PredisTestCase
     {
         $option = new ClusterOption();
         $options = $this->getMock('Predis\Configuration\OptionsInterface');
-        $class = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $class = $this->getMock('Predis\Connection\NodeConnectionInterface');
 
         $option->filter($options, $class);
     }

+ 1 - 1
tests/Predis/Configuration/ConnectionFactoryOptionTest.php

@@ -39,7 +39,7 @@ class ConnectionFactoryOptionTest extends PredisTestCase
         $option = new ConnectionFactoryOption();
         $options = $this->getMock('Predis\Configuration\OptionsInterface');
 
-        $class = get_class($this->getMock('Predis\Connection\SingleConnectionInterface'));
+        $class = get_class($this->getMock('Predis\Connection\NodeConnectionInterface'));
         $value = array('tcp' => $class, 'redis' => $class);
 
         $default = $this->getMock('Predis\Connection\FactoryInterface');

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

@@ -29,8 +29,8 @@ class OptionsTest extends PredisTestCase
 
         $this->assertInstanceOf('Predis\Connection\FactoryInterface', $options->connections);
         $this->assertInstanceOf('Predis\Profile\ProfileInterface', $options->profile);
-        $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $options->cluster);
-        $this->assertInstanceOf('Predis\Connection\ReplicationConnectionInterface', $options->replication);
+        $this->assertInstanceOf('Predis\Connection\Aggregate\ClusterInterface', $options->cluster);
+        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $options->replication);
         $this->assertTrue($options->exceptions);
         $this->assertNull($options->prefix);
     }
@@ -45,16 +45,16 @@ class OptionsTest extends PredisTestCase
             'profile'     => '2.0',
             'prefix'      => 'prefix:',
             'connections' => $this->getMock('Predis\Connection\FactoryInterface'),
-            'cluster'     => $this->getMock('Predis\Connection\ClusterConnectionInterface'),
-            'replication' => $this->getMock('Predis\Connection\ReplicationConnectionInterface'),
+            'cluster'     => $this->getMock('Predis\Connection\Aggregate\ClusterInterface'),
+            'replication' => $this->getMock('Predis\Connection\Aggregate\ReplicationInterface'),
         ));
 
         $this->assertInternalType('bool', $options->exceptions);
         $this->assertInstanceOf('Predis\Profile\ProfileInterface', $options->profile);
         $this->assertInstanceOf('Predis\Command\Processor\ProcessorInterface', $options->prefix);
         $this->assertInstanceOf('Predis\Connection\FactoryInterface', $options->connections);
-        $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $options->cluster);
-        $this->assertInstanceOf('Predis\Connection\ReplicationConnectionInterface', $options->replication);
+        $this->assertInstanceOf('Predis\Connection\Aggregate\ClusterInterface', $options->cluster);
+        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $options->replication);
     }
 
     /**

+ 7 - 7
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\ReplicationConnectionInterface', $option->getDefault($options));
-        $this->assertInstanceOf('Predis\Connection\MasterSlaveReplication', $option->getDefault($options));
+        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $option->getDefault($options));
+        $this->assertInstanceOf('Predis\Connection\Aggregate\MasterSlaveReplication', $option->getDefault($options));
     }
 
     /**
@@ -40,16 +40,16 @@ class ReplicationOptionTest extends PredisTestCase
 
         $this->assertNull($option->filter($options, null));
 
-        $this->assertInstanceOf('Predis\Connection\ReplicationConnectionInterface', $option->filter($options, true));
+        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $option->filter($options, true));
         $this->assertNull($option->filter($options, false));
 
-        $this->assertInstanceOf('Predis\Connection\ReplicationConnectionInterface', $option->filter($options, 1));
+        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $option->filter($options, 1));
         $this->assertNull($option->filter($options, 0));
 
-        $this->assertInstanceOf('Predis\Connection\ReplicationConnectionInterface', $option->filter($options, 'true'));
+        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $option->filter($options, 'true'));
         $this->assertNull($option->filter($options, 'false'));
 
-        $this->assertInstanceOf('Predis\Connection\ReplicationConnectionInterface', $option->filter($options, 'on'));
+        $this->assertInstanceOf('Predis\Connection\Aggregate\ReplicationInterface', $option->filter($options, 'on'));
         $this->assertNull($option->filter($options, 'off'));
     }
 
@@ -61,7 +61,7 @@ class ReplicationOptionTest extends PredisTestCase
     {
         $option = new ReplicationOption();
         $options = $this->getMock('Predis\Configuration\OptionsInterface');
-        $value = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $value = $this->getMock('Predis\Connection\NodeConnectionInterface');
 
         $option->filter($options, $value);
     }

+ 5 - 4
tests/Predis/Connection/MasterSlaveReplicationTest.php → tests/Predis/Connection/Aggregate/MasterSlaveReplicationTest.php

@@ -9,9 +9,10 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection;
+namespace Predis\Connection\Aggregate;
 
 use PredisTestCase;
+use Predis\Connection;
 use Predis\Profile;
 use Predis\Replication\ReplicationStrategy;
 
@@ -567,17 +568,17 @@ class MasterSlaveReplicationTest extends PredisTestCase
     // ******************************************************************** //
 
     /**
-     * Returns a base mocked connection from Predis\Connection\SingleConnectionInterface.
+     * Returns a base mocked connection from Predis\Connection\NodeConnectionInterface.
      *
      * @param  mixed $parameters Optional parameters.
      * @return mixed
      */
     protected function getMockConnection($parameters = null)
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
 
         if ($parameters) {
-            $parameters = Parameters::create($parameters);
+            $parameters = Connection\Parameters::create($parameters);
             $hash = "{$parameters->host}:{$parameters->port}";
 
             $connection->expects($this->any())

+ 7 - 6
tests/Predis/Connection/PredisClusterTest.php → tests/Predis/Connection/Aggregate/PredisClusterTest.php

@@ -9,9 +9,10 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection;
+namespace Predis\Connection\Aggregate;
 
 use PredisTestCase;
+use Predis\Connection;
 use Predis\Profile;
 
 /**
@@ -335,13 +336,13 @@ class PredisClusterTest extends PredisTestCase
     {
         $ping = Profile\Factory::getDefault()->createCommand('ping', array());
 
-        $connection1 = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection1 = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection1->expects($this->once())
                     ->method('executeCommand')
                     ->with($ping)
                     ->will($this->returnValue(true));
 
-        $connection2 = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection2 = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection2->expects($this->once())
                     ->method('executeCommand')
                     ->with($ping)
@@ -378,17 +379,17 @@ class PredisClusterTest extends PredisTestCase
     // ******************************************************************** //
 
     /**
-     * Returns a base mocked connection from Predis\Connection\SingleConnectionInterface.
+     * Returns a base mocked connection from Predis\Connection\NodeConnectionInterface.
      *
      * @param  mixed $parameters Optional parameters.
      * @return mixed
      */
     protected function getMockConnection($parameters = null)
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
 
         if ($parameters) {
-            $parameters = Parameters::create($parameters);
+            $parameters = Connection\Parameters::create($parameters);
             $hash = "{$parameters->host}:{$parameters->port}";
 
             $connection->expects($this->any())

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

@@ -9,9 +9,10 @@
  * file that was distributed with this source code.
  */
 
-namespace Predis\Connection;
+namespace Predis\Connection\Aggregate;
 
 use PredisTestCase;
+use Predis\Connection;
 use Predis\Profile;
 use Predis\Response;
 
@@ -641,17 +642,17 @@ class RedisClusterTest extends PredisTestCase
     // ******************************************************************** //
 
     /**
-     * Returns a base mocked connection from Predis\Connection\SingleConnectionInterface.
+     * Returns a base mocked connection from Predis\Connection\NodeConnectionInterface.
      *
      * @param  mixed $parameters Optional parameters.
      * @return mixed
      */
     protected function getMockConnection($parameters = null)
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
 
         if ($parameters) {
-            $parameters = Parameters::create($parameters);
+            $parameters = Connection\Parameters::create($parameters);
             $hash = "{$parameters->host}:{$parameters->port}";
 
             $connection->expects($this->any())

+ 6 - 6
tests/Predis/Connection/ComposableStreamConnectionTest.php

@@ -14,14 +14,14 @@ namespace Predis\Connection;
 /**
  *
  */
-class ComposableStreamConnectionTest extends PredisConnectionTestCase
+class CompositeStreamConnectionTest extends PredisConnectionTestCase
 {
     /**
      * @group disconnected
      */
     public function testConstructorDoesNotOpenConnection()
     {
-        $connection = new ComposableStreamConnection($this->getParameters());
+        $connection = new CompositeStreamConnection($this->getParameters());
 
         $this->assertFalse($connection->isConnected());
     }
@@ -32,7 +32,7 @@ class ComposableStreamConnectionTest extends PredisConnectionTestCase
     public function testExposesParameters()
     {
         $parameters = $this->getParameters();
-        $connection = new ComposableStreamConnection($parameters);
+        $connection = new CompositeStreamConnection($parameters);
 
         $this->assertSame($parameters, $connection->getParameters());
     }
@@ -45,7 +45,7 @@ class ComposableStreamConnectionTest extends PredisConnectionTestCase
     public function testThrowsExceptionOnInvalidScheme()
     {
         $parameters = $this->getParameters(array('scheme' => 'udp'));
-        $connection = new ComposableStreamConnection($parameters);
+        $connection = new CompositeStreamConnection($parameters);
     }
 
     /**
@@ -54,7 +54,7 @@ class ComposableStreamConnectionTest extends PredisConnectionTestCase
     public function testCanBeSerialized()
     {
         $parameters = $this->getParameters(array('alias' => 'redis', 'read_write_timeout' => 10));
-        $connection = new ComposableStreamConnection($parameters);
+        $connection = new CompositeStreamConnection($parameters);
 
         $unserialized = unserialize(serialize($connection));
 
@@ -108,7 +108,7 @@ class ComposableStreamConnectionTest extends PredisConnectionTestCase
         $parameters = $this->getParameters($parameters);
         $profile = $this->getProfile();
 
-        $connection = new ComposableStreamConnection($parameters);
+        $connection = new CompositeStreamConnection($parameters);
 
         if ($initialize) {
             $connection->addConnectCommand(

+ 1 - 1
tests/Predis/Connection/ConnectionExceptionTest.php

@@ -23,7 +23,7 @@ class ConnectionExceptionTest extends CommunicationExceptionTest
     /**
      * {@inheritdoc}
      */
-    protected function getException(SingleConnectionInterface $connection, $message, $code = 0, \Exception $inner = null)
+    protected function getException(NodeConnectionInterface $connection, $message, $code = 0, \Exception $inner = null)
     {
         return new ConnectionException($connection, $message, $code, $inner);
     }

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

@@ -68,7 +68,7 @@ class FactoryTest extends PredisTestCase
         $connection = $factory->create(null);
         $parameters = $connection->getParameters();
 
-        $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $connection);
+        $this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $connection);
         $this->assertEquals('tcp', $parameters->scheme);
 
         $this->assertFalse(isset($parameters->custom));
@@ -84,7 +84,7 @@ class FactoryTest extends PredisTestCase
         $connection = $factory->create(array('scheme' => 'tcp', 'custom' => 'foobar'));
         $parameters = $connection->getParameters();
 
-        $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $connection);
+        $this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $connection);
         $this->assertEquals('tcp', $parameters->scheme);
 
         $this->assertTrue(isset($parameters->custom));
@@ -100,7 +100,7 @@ class FactoryTest extends PredisTestCase
         $connection = $factory->create('tcp://127.0.0.1?custom=foobar');
         $parameters = $connection->getParameters();
 
-        $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $connection);
+        $this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $connection);
         $this->assertEquals('tcp', $parameters->scheme);
 
         $this->assertTrue(isset($parameters->custom));
@@ -119,7 +119,7 @@ class FactoryTest extends PredisTestCase
         $parameters = new Parameters();
         $connection = $factory->create($parameters);
 
-        $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $connection);
+        $this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $connection);
     }
 
     /**
@@ -133,7 +133,7 @@ class FactoryTest extends PredisTestCase
             'password' => 'foobar'
         ));
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->once())
                    ->method('getParameters')
                    ->will($this->returnValue($parameters));
@@ -239,7 +239,7 @@ class FactoryTest extends PredisTestCase
         $factory->undefine('unknown');
         $connection = $factory->create('tcp://127.0.0.1');
 
-        $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $connection);
+        $this->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $connection);
     }
 
     /**
@@ -267,10 +267,10 @@ class FactoryTest extends PredisTestCase
     {
         list(, $connectionClass) = $this->getMockConnectionClass();
 
-        $cluster = $this->getMock('Predis\Connection\ClusterConnectionInterface');
+        $cluster = $this->getMock('Predis\Connection\Aggregate\ClusterInterface');
         $cluster->expects($this->exactly(2))
                 ->method('add')
-                ->with($this->isInstanceOf('Predis\Connection\SingleConnectionInterface'));
+                ->with($this->isInstanceOf('Predis\Connection\NodeConnectionInterface'));
 
         $factory = $this->getMock('Predis\Connection\Factory', array('create'));
         $factory->expects($this->never())
@@ -286,10 +286,10 @@ class FactoryTest extends PredisTestCase
     {
         list(, $connectionClass) = $this->getMockConnectionClass();
 
-        $cluster = $this->getMock('Predis\Connection\ClusterConnectionInterface');
+        $cluster = $this->getMock('Predis\Connection\Aggregate\ClusterInterface');
         $cluster->expects($this->exactly(4))
                 ->method('add')
-                ->with($this->isInstanceOf('Predis\Connection\SingleConnectionInterface'));
+                ->with($this->isInstanceOf('Predis\Connection\NodeConnectionInterface'));
 
         $factory = $this->getMock('Predis\Connection\Factory', array('create'));
         $factory->expects($this->exactly(3))
@@ -306,7 +306,7 @@ class FactoryTest extends PredisTestCase
      */
     public function testAggregateConnectionWithEmptyListOfParameters()
     {
-        $cluster = $this->getMock('Predis\Connection\ClusterConnectionInterface');
+        $cluster = $this->getMock('Predis\Connection\Aggregate\ClusterInterface');
         $cluster->expects($this->never())->method('add');
 
         $factory = $this->getMock('Predis\Connection\Factory', array('create'));
@@ -321,13 +321,13 @@ class FactoryTest extends PredisTestCase
     // ******************************************************************** //
 
     /**
-     * Returns a mocked Predis\Connection\SingleConnectionInterface.
+     * Returns a mocked Predis\Connection\NodeConnectionInterface.
      *
      * @return array Mock instance and class name
      */
     protected function getMockConnectionClass()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
 
         return array($connection, get_class($connection));
     }

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

@@ -45,7 +45,7 @@ class ConsumerTest extends PredisTestCase
      */
     public function testMonitorConsumerDoesNotWorkOnClusters()
     {
-        $cluster = $this->getMock('Predis\Connection\ClusterConnectionInterface');
+        $cluster = $this->getMock('Predis\Connection\Aggregate\ClusterInterface');
 
         $client = new Client($cluster);
         $monitor = new MonitorConsumer($client);
@@ -58,7 +58,7 @@ class ConsumerTest extends PredisTestCase
     {
         $cmdMonitor = Profile\Factory::getDefault()->createCommand('monitor');
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
 
         $client = $this->getMock('Predis\Client', array('createCommand', 'executeCommand'), array($connection));
         $client->expects($this->once())
@@ -80,7 +80,7 @@ class ConsumerTest extends PredisTestCase
      */
     public function testStoppingConsumerClosesConnection()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
 
         $client = $this->getMock('Predis\Client', array('disconnect'), array($connection));
         $client->expects($this->exactly(2))->method('disconnect');
@@ -94,7 +94,7 @@ class ConsumerTest extends PredisTestCase
      */
     public function testGarbageCollectorRunStopsConsumer()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
 
         $client = $this->getMock('Predis\Client', array('disconnect'), array($connection));
         $client->expects($this->once())->method('disconnect');
@@ -110,7 +110,7 @@ class ConsumerTest extends PredisTestCase
     {
         $message = '1323367530.939137 (db 15) "MONITOR"';
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->once())
                    ->method('read')
                    ->will($this->returnValue($message));
@@ -133,7 +133,7 @@ class ConsumerTest extends PredisTestCase
     {
         $message = '1323367530.939137 [15 127.0.0.1:37265] "MONITOR"';
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->once())
                    ->method('read')
                    ->will($this->returnValue($message));

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

@@ -28,7 +28,7 @@ class AtomicTest extends PredisTestCase
         $pong = new Response\Status('PONG');
         $queued = new Response\Status('QUEUED');
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->exactly(2))
                    ->method('executeCommand')
                    ->will($this->onConsecutiveCalls(true, array($pong, $pong, $pong)));
@@ -54,7 +54,7 @@ class AtomicTest extends PredisTestCase
      */
     public function testThrowsExceptionOnAbortedTransaction()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->exactly(2))
                    ->method('executeCommand')
                    ->will($this->onConsecutiveCalls(true, null));
@@ -78,7 +78,7 @@ class AtomicTest extends PredisTestCase
         $queued = new Response\Status('QUEUED');
         $error = new Response\Error('ERR Test error');
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->at(0))
                    ->method('executeCommand')
                    ->will($this->returnValue(true));
@@ -107,7 +107,7 @@ class AtomicTest extends PredisTestCase
     {
         $error = new Response\Error('ERR Test error');
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->once())
                    ->method('readResponse')
                    ->will($this->returnValue($error));
@@ -129,7 +129,7 @@ class AtomicTest extends PredisTestCase
         $queued = new Response\Status('QUEUED');
         $error = new Response\Error('ERR Test error');
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->exactly(3))
                    ->method('readResponse')
                    ->will($this->onConsecutiveCalls($queued, $queued, $queued));
@@ -153,7 +153,7 @@ class AtomicTest extends PredisTestCase
      */
     public function testExecutorWithAggregateConnection()
     {
-        $connection = $this->getMock('Predis\Connection\ClusterConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\Aggregate\ClusterInterface');
         $pipeline = new Atomic(new Client($connection));
 
         $pipeline->ping();

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

@@ -27,7 +27,7 @@ class FireAndForgetTest extends PredisTestCase
     {
         $profile = Profile\Factory::getDefault();
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->exactly(3))->method('writeRequest');
         $connection->expects($this->never())->method('readResponse');
 
@@ -47,7 +47,7 @@ class FireAndForgetTest extends PredisTestCase
     {
         $profile = Profile\Factory::getDefault();
 
-        $connection = $this->getMock('Predis\Connection\ReplicationConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\Aggregate\ReplicationInterface');
         $connection->expects($this->once())
                    ->method('switchTo')
                    ->with('master');

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

@@ -40,7 +40,7 @@ class PipelineTest extends PredisTestCase
      */
     public function testCallDoesNotSendCommandsWithoutExecute()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->never())->method('writeRequest');
         $connection->expects($this->never())->method('readResponse');
 
@@ -56,7 +56,7 @@ class PipelineTest extends PredisTestCase
      */
     public function testCallReturnsPipelineForFluentInterface()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->never())->method('writeRequest');
         $connection->expects($this->never())->method('readResponse');
 
@@ -73,7 +73,7 @@ class PipelineTest extends PredisTestCase
     {
         $object = $this->getMock('Predis\Response\ResponseInterface');
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->once())
                    ->method('readResponse')
                    ->will($this->returnValue($object));
@@ -94,7 +94,7 @@ class PipelineTest extends PredisTestCase
     {
         $error = new Response\Error('ERR Test error');
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->once())
                    ->method('readResponse')
                    ->will($this->returnValue($error));
@@ -114,7 +114,7 @@ class PipelineTest extends PredisTestCase
     {
         $error = $this->getMock('Predis\Response\ErrorInterface');
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->exactly(2))
                    ->method('readResponse')
                    ->will($this->returnValue($error));
@@ -135,7 +135,7 @@ class PipelineTest extends PredisTestCase
     public function testExecuteReturnsPipelineForFluentInterface()
     {
         $profile = Profile\Factory::getDefault();
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $pipeline = new Pipeline(new Client($connection));
         $command = $profile->createCommand('echo', array('one'));
 
@@ -149,7 +149,7 @@ class PipelineTest extends PredisTestCase
     {
         $profile = Profile\Factory::getDefault();
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->never())->method('writeRequest');
         $connection->expects($this->never())->method('readResponse');
 
@@ -165,7 +165,7 @@ class PipelineTest extends PredisTestCase
      */
     public function testExecuteWithEmptyBuffer()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->never())->method('writeRequest');
         $connection->expects($this->never())->method('readResponse');
 
@@ -179,7 +179,7 @@ class PipelineTest extends PredisTestCase
      */
     public function testExecuteWithFilledBuffer()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->exactly(3))
                    ->method('writeRequest');
         $connection->expects($this->exactly(3))
@@ -218,7 +218,7 @@ class PipelineTest extends PredisTestCase
      */
     public function testFlushHandlesPartialBuffers()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->exactly(4))
                    ->method('writeRequest');
         $connection->expects($this->exactly(4))
@@ -243,7 +243,7 @@ class PipelineTest extends PredisTestCase
     {
         $pong = new Response\Status('PONG');
 
-        $connection = $this->getMock('Predis\Connection\ReplicationConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\Aggregate\ReplicationInterface');
         $connection->expects($this->once())
                    ->method('switchTo')
                    ->with('master');
@@ -308,7 +308,7 @@ class PipelineTest extends PredisTestCase
      */
     public function testExecuteWithCallableArgumentRunsPipelineInCallable()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->exactly(4))
                    ->method('writeRequest');
         $connection->expects($this->exactly(4))
@@ -334,7 +334,7 @@ class PipelineTest extends PredisTestCase
     {
         $exception = null;
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->never())->method('writeRequest');
         $connection->expects($this->never())->method('readResponse');
 

+ 2 - 2
tests/Predis/Protocol/ProtocolExceptionTest.php

@@ -14,7 +14,7 @@ namespace Predis\Protocol;
 require_once __DIR__.'/../CommunicationExceptionTest.php';
 
 use Predis\CommunicationExceptionTest;
-use Predis\Connection\SingleConnectionInterface;
+use Predis\Connection\NodeConnectionInterface;
 
 /**
  *
@@ -24,7 +24,7 @@ class ProtocolExceptionTest extends CommunicationExceptionTest
     /**
      * {@inheritdoc}
      */
-    protected function getException(SingleConnectionInterface $connection, $message, $code = 0, \Exception $inner = null)
+    protected function getException(NodeConnectionInterface $connection, $message, $code = 0, \Exception $inner = null)
     {
         return new ProtocolException($connection, $message, $code, $inner);
     }

+ 9 - 9
tests/Predis/Protocol/Text/ComposableProtocolProcessorTest.php → tests/Predis/Protocol/Text/CompositeProtocolProcessorTest.php

@@ -16,14 +16,14 @@ use PredisTestCase;
 /**
  *
  */
-class ComposableProtocolProcessorTest extends PredisTestCase
+class CompositeProtocolProcessorTest extends PredisTestCase
 {
     /**
      * @group disconnected
      */
     public function testConstructor()
     {
-        $protocol = new ComposableProtocolProcessor();
+        $protocol = new CompositeProtocolProcessor();
 
         $this->assertInstanceOf(
             'Predis\Protocol\Text\RequestSerializer', $protocol->getRequestSerializer()
@@ -41,7 +41,7 @@ class ComposableProtocolProcessorTest extends PredisTestCase
         $serializer = $this->getMock('Predis\Protocol\RequestSerializerInterface');
         $reader = $this->getMock('Predis\Protocol\ResponseReaderInterface');
 
-        $protocol = new ComposableProtocolProcessor($serializer, $reader);
+        $protocol = new CompositeProtocolProcessor($serializer, $reader);
 
         $this->assertSame($serializer, $protocol->getRequestSerializer());
         $this->assertSame($reader, $protocol->getResponseReader());
@@ -54,7 +54,7 @@ class ComposableProtocolProcessorTest extends PredisTestCase
     {
         $serializer = $this->getMock('Predis\Protocol\RequestSerializerInterface');
 
-        $protocol = new ComposableProtocolProcessor();
+        $protocol = new CompositeProtocolProcessor();
         $protocol->setRequestSerializer($serializer);
 
         $this->assertSame($serializer, $protocol->getRequestSerializer());
@@ -67,7 +67,7 @@ class ComposableProtocolProcessorTest extends PredisTestCase
     {
         $reader = $this->getMock('Predis\Protocol\ResponseReaderInterface');
 
-        $protocol = new ComposableProtocolProcessor();
+        $protocol = new CompositeProtocolProcessor();
         $protocol->setResponseReader($reader);
 
         $this->assertSame($reader, $protocol->getResponseReader());
@@ -81,10 +81,10 @@ class ComposableProtocolProcessorTest extends PredisTestCase
         $serialized = "*1\r\n$4\r\nPING\r\n";
 
         $command = $this->getMock('Predis\Command\CommandInterface');
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
         $serializer = $this->getMock('Predis\Protocol\RequestSerializerInterface');
 
-        $protocol = new ComposableProtocolProcessor($serializer);
+        $protocol = new CompositeProtocolProcessor($serializer);
 
         $connection->expects($this->once())
                    ->method('writeBuffer')
@@ -105,10 +105,10 @@ class ComposableProtocolProcessorTest extends PredisTestCase
     {
         $serialized = "*1\r\n$4\r\nPING\r\n";
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
         $reader = $this->getMock('Predis\Protocol\ResponseReaderInterface');
 
-        $protocol = new ComposableProtocolProcessor(null, $reader);
+        $protocol = new CompositeProtocolProcessor(null, $reader);
 
         $reader->expects($this->once())
                    ->method('read')

+ 4 - 4
tests/Predis/Protocol/Text/Handler/BulkResponseTest.php

@@ -25,7 +25,7 @@ class BulkResponseTest extends PredisTestCase
     {
         $handler = new Handler\BulkResponse();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->never())->method('readLine');
         $connection->expects($this->once())
@@ -46,7 +46,7 @@ class BulkResponseTest extends PredisTestCase
 
         $handler = new Handler\BulkResponse();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->never())->method('readLine');
         $connection->expects($this->once())
@@ -64,7 +64,7 @@ class BulkResponseTest extends PredisTestCase
     {
         $handler = new Handler\BulkResponse();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->never())->method('readLine');
         $connection->expects($this->never())->method('readBuffer');
@@ -81,7 +81,7 @@ class BulkResponseTest extends PredisTestCase
     {
         $handler = new Handler\BulkResponse();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->never())->method('readLine');
         $connection->expects($this->never())->method('readBuffer');

+ 1 - 1
tests/Predis/Protocol/Text/Handler/ErrorResponseTest.php

@@ -25,7 +25,7 @@ class ErrorResponseTest extends PredisTestCase
     {
         $handler = new Handler\ErrorResponse();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->never())->method('readLine');
         $connection->expects($this->never())->method('readBuffer');

+ 3 - 3
tests/Predis/Protocol/Text/Handler/IntegerResponseTest.php

@@ -25,7 +25,7 @@ class IntegerResponseTest extends PredisTestCase
     {
         $handler = new Handler\IntegerResponse();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->never())->method('readLine');
         $connection->expects($this->never())->method('readBuffer');
@@ -43,7 +43,7 @@ class IntegerResponseTest extends PredisTestCase
     {
         $handler = new Handler\IntegerResponse();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->never())->method('readLine');
         $connection->expects($this->never())->method('readBuffer');
@@ -60,7 +60,7 @@ class IntegerResponseTest extends PredisTestCase
     {
         $handler = new Handler\IntegerResponse();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->never())->method('readLine');
         $connection->expects($this->never())->method('readBuffer');

+ 4 - 4
tests/Predis/Protocol/Text/Handler/MultiBulkResponseTest.php

@@ -25,11 +25,11 @@ class MultiBulkResponseTest extends PredisTestCase
     {
         $handler = new Handler\MultiBulkResponse();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->once())
                    ->method('getProtocol')
-                   ->will($this->returnValue(new ComposableProtocolProcessor()));
+                   ->will($this->returnValue(new CompositeProtocolProcessor()));
 
         $connection->expects($this->at(1))
                    ->method('readLine')
@@ -57,7 +57,7 @@ class MultiBulkResponseTest extends PredisTestCase
     {
         $handler = new Handler\MultiBulkResponse();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->never())->method('readLine');
         $connection->expects($this->never())->method('readBuffer');
@@ -74,7 +74,7 @@ class MultiBulkResponseTest extends PredisTestCase
     {
         $handler = new Handler\MultiBulkResponse();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->never())->method('readLine');
         $connection->expects($this->never())->method('readBuffer');

+ 3 - 3
tests/Predis/Protocol/Text/Handler/StatusResponseTest.php

@@ -25,7 +25,7 @@ class StatusResponseTest extends PredisTestCase
     {
         $handler = new Handler\StatusResponse();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->never())->method('readLine');
         $connection->expects($this->never())->method('readBuffer');
@@ -43,7 +43,7 @@ class StatusResponseTest extends PredisTestCase
     {
         $handler = new Handler\StatusResponse();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->never())->method('readLine');
         $connection->expects($this->never())->method('readBuffer');
@@ -61,7 +61,7 @@ class StatusResponseTest extends PredisTestCase
     {
         $handler = new Handler\StatusResponse();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->never())->method('readLine');
         $connection->expects($this->never())->method('readBuffer');

+ 2 - 2
tests/Predis/Protocol/Text/Handler/StreamableMultiBulkResponseTest.php

@@ -25,7 +25,7 @@ class StreamableMultiBulkResponseTest extends PredisTestCase
     {
         $handler = new Handler\StreamableMultiBulkResponse();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->never())->method('readLine');
         $connection->expects($this->never())->method('readBuffer');
@@ -42,7 +42,7 @@ class StreamableMultiBulkResponseTest extends PredisTestCase
     {
         $handler = new Handler\StreamableMultiBulkResponse();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->never())->method('readLine');
         $connection->expects($this->never())->method('readBuffer');

+ 4 - 4
tests/Predis/Protocol/Text/ProtocolProcessorTest.php

@@ -36,7 +36,7 @@ class ProtocolProcessorTest extends PredisTestCase
                 ->method('getArguments')
                 ->will($this->returnValue(array()));
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->once())
                    ->method('writeBuffer')
@@ -53,7 +53,7 @@ class ProtocolProcessorTest extends PredisTestCase
     {
         $protocol = new ProtocolProcessor();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->at(0))
                    ->method('readLine')
@@ -90,7 +90,7 @@ class ProtocolProcessorTest extends PredisTestCase
         $protocol = new ProtocolProcessor();
         $protocol->useIterableMultibulk(true);
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->once(4))
                    ->method('readLine')
@@ -108,7 +108,7 @@ class ProtocolProcessorTest extends PredisTestCase
     {
         $protocol = new ProtocolProcessor();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->once())
                    ->method('readLine')

+ 4 - 4
tests/Predis/Protocol/Text/ResponseReaderTest.php

@@ -54,10 +54,10 @@ class ResponseReaderTest extends PredisTestCase
     {
         $reader = new ResponseReader();
 
-        $protocol = new ComposableProtocolProcessor();
+        $protocol = new CompositeProtocolProcessor();
         $protocol->setResponseReader($reader);
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->at(0))
                    ->method('readLine')
@@ -95,7 +95,7 @@ class ResponseReaderTest extends PredisTestCase
     {
         $reader = new ResponseReader();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->once())
                    ->method('readLine')
@@ -112,7 +112,7 @@ class ResponseReaderTest extends PredisTestCase
     {
         $reader = new ResponseReader();
 
-        $connection = $this->getMock('Predis\Connection\ComposableConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\CompositeConnectionInterface');
 
         $connection->expects($this->once())
                    ->method('readLine')

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

@@ -44,7 +44,7 @@ class ConsumerTest extends PredisTestCase
      */
     public function testPubSubConsumerDoesNotWorkOnClusters()
     {
-        $cluster = $this->getMock('Predis\Connection\ClusterConnectionInterface');
+        $cluster = $this->getMock('Predis\Connection\Aggregate\ClusterInterface');
 
         $client = new Client($cluster);
         $pubsub = new PubSubConsumer($client);
@@ -55,7 +55,7 @@ class ConsumerTest extends PredisTestCase
      */
     public function testConstructorWithoutSubscriptionsDoesNotStartConsumer()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
 
         $client = $this->getMock('Predis\Client', array('executeCommand'), array($connection));
         $client->expects($this->never())->method('executeCommand');
@@ -73,7 +73,7 @@ class ConsumerTest extends PredisTestCase
         $cmdSubscribe = $profile->createCommand('subscribe', array('channel:foo'));
         $cmdPsubscribe = $profile->createCommand('psubscribe', array('channels:*'));
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->exactly(2))->method('writeRequest');
 
         $client = $this->getMock('Predis\Client', array('createCommand', 'writeRequest'), array($connection));
@@ -93,7 +93,7 @@ class ConsumerTest extends PredisTestCase
      */
     public function testStoppingConsumerWithTrueClosesConnection()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
 
         $client = $this->getMock('Predis\Client', array('disconnect'), array($connection));
         $client->expects($this->exactly(1))->method('disconnect');
@@ -114,7 +114,7 @@ class ConsumerTest extends PredisTestCase
         $classUnsubscribe = $profile->getCommandClass('unsubscribe');
         $classPunsubscribe = $profile->getCommandClass('punsubscribe');
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
 
         $client = $this->getMock('Predis\Client', array('disconnect'), array($connection));
 
@@ -136,7 +136,7 @@ class ConsumerTest extends PredisTestCase
      */
     public function testIsNotValidWhenNotSubscribed()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $client = $this->getMock('Predis\Client', array('disconnect'), array($connection));
 
         $pubsub = new PubSubConsumer($client);
@@ -152,7 +152,7 @@ class ConsumerTest extends PredisTestCase
     {
         $rawmessage = array('message', 'channel:foo', 'message from channel');
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->once())->method('read')->will($this->returnValue($rawmessage));
 
         $client = new Client($connection);
@@ -171,7 +171,7 @@ class ConsumerTest extends PredisTestCase
     {
         $rawmessage = array('pmessage', 'channel:*', 'channel:foo', 'message from channel');
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->once())->method('read')->will($this->returnValue($rawmessage));
 
         $client = new Client($connection);
@@ -191,7 +191,7 @@ class ConsumerTest extends PredisTestCase
     {
         $rawmessage = array('subscribe', 'channel:foo', 1);
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->once())->method('read')->will($this->returnValue($rawmessage));
 
         $client = new Client($connection);
@@ -210,7 +210,7 @@ class ConsumerTest extends PredisTestCase
     {
         $rawmessage = array('unsubscribe', 'channel:foo', 1);
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->once())->method('read')->will($this->returnValue($rawmessage));
 
         $client = new Client($connection);
@@ -229,7 +229,7 @@ class ConsumerTest extends PredisTestCase
     {
         $rawmessage = array('unsubscribe', 'channel:foo', 0);
 
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->once())->method('read')->will($this->returnValue($rawmessage));
 
         $client = new Client($connection);
@@ -250,7 +250,7 @@ class ConsumerTest extends PredisTestCase
      */
     public function testGetUnderlyingClientInstance()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
 
         $client = new Client($connection);
         $pubsub = new PubSubConsumer($client);

+ 2 - 2
tests/Predis/Response/Iterator/MultiBulkTest.php

@@ -13,7 +13,7 @@ namespace Predis\Response\Iterator;
 
 use PredisTestCase;
 use Predis\Client;
-use Predis\Connection\ComposableStreamConnection;
+use Predis\Connection\CompositeStreamConnection;
 use Predis\Protocol\Text\ProtocolProcessor as TextProtocolProcessor;
 
 /**
@@ -123,7 +123,7 @@ class MultiBulkTest extends PredisTestCase
         $protocol = new TextProtocolProcessor();
         $protocol->useIterableMultibulk(true);
 
-        $connection = new ComposableStreamConnection($parameters, $protocol);
+        $connection = new CompositeStreamConnection($parameters, $protocol);
 
         $client = new Client($connection);
         $client->connect();

+ 4 - 4
tests/Predis/Response/Iterator/MultiBulkTupleTest.php

@@ -13,7 +13,7 @@ namespace Predis\Response\Iterator;
 
 use PredisTestCase;
 use Predis\Client;
-use Predis\Connection\ComposableStreamConnection;
+use Predis\Connection\CompositeStreamConnection;
 use Predis\Protocol\Text\ProtocolProcessor as TextProtocolProcessor;
 
 /**
@@ -28,7 +28,7 @@ class MultiBulkTupleTest extends PredisTestCase
      */
     public function testInitiatedMultiBulkIteratorsAreNotValid()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $iterator = new MultiBulk($connection, 2);
         $iterator->next();
 
@@ -42,7 +42,7 @@ class MultiBulkTupleTest extends PredisTestCase
      */
     public function testMultiBulkWithOddSizesAreInvalid()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $iterator = new MultiBulk($connection, 3);
 
         new MultiBulkTuple($iterator);
@@ -109,7 +109,7 @@ class MultiBulkTupleTest extends PredisTestCase
         $protocol = new TextProtocolProcessor();
         $protocol->useIterableMultibulk(true);
 
-        $connection = new ComposableStreamConnection($parameters, $protocol);
+        $connection = new CompositeStreamConnection($parameters, $protocol);
 
         $client = new Client($connection);
         $client->connect();

+ 7 - 7
tests/Predis/Transaction/MultiExecTest.php

@@ -28,7 +28,7 @@ class MultiExecTest extends PredisTestCase
      */
     public function testThrowsExceptionOnUnsupportedMultiExecInProfile()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $client = new Client($connection, array('profile' => '1.2'));
         $tx = new MultiExec($client);
     }
@@ -40,7 +40,7 @@ class MultiExecTest extends PredisTestCase
      */
     public function testThrowsExceptionOnUnsupportedWatchInProfile()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $client = new Client($connection, array('profile' => '2.0'));
         $tx = new MultiExec($client, array('options' => 'cas'));
 
@@ -54,7 +54,7 @@ class MultiExecTest extends PredisTestCase
      */
     public function testThrowsExceptionOnUnsupportedUnwatchInProfile()
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $client = new Client($connection, array('profile' => '2.0'));
         $tx = new MultiExec($client, array('options' => 'cas'));
 
@@ -727,15 +727,15 @@ class MultiExecTest extends PredisTestCase
     // ******************************************************************** //
 
     /**
-     * Returns a mocked instance of Predis\Connection\SingleConnectionInterface
+     * Returns a mocked instance of Predis\Connection\NodeConnectionInterface
      * using the specified callback to return values from executeCommand().
      *
-     * @param  \Closure                                     $executeCallback
-     * @return \Predis\Connection\SingleConnectionInterface
+     * @param  \Closure                                   $executeCallback
+     * @return \Predis\Connection\NodeConnectionInterface
      */
     protected function getMockedConnection($executeCallback)
     {
-        $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
+        $connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
         $connection->expects($this->any())
                    ->method('executeCommand')
                    ->will($this->returnCallback($executeCallback));

+ 1 - 1
tests/bootstrap.php

@@ -11,7 +11,7 @@
 
 if (file_exists(__DIR__.'/../autoload.php')) {
     require __DIR__.'/../autoload.php';
-} else if (@include('Predis/Autoloader.php')) {
+} elseif (@include('Predis/Autoloader.php')) {
     Predis\Autoloader::register();
 } else {
     die('ERROR: Unable to find a suitable mean to register Predis\Autoloader.');