Parcourir la source

Rename classes in Predis\Response and Predis\Response\Iterator.

This change aims to make class names shorter with less redundant fully
qualified names.

Merge!
Daniele Alessandri il y a 11 ans
Parent
commit
b71c798f9b
43 fichiers modifiés avec 150 ajouts et 166 suppressions
  1. 7 9
      lib/Predis/Client.php
  2. 3 4
      lib/Predis/Connection/PhpiredisConnection.php
  3. 3 4
      lib/Predis/Connection/PhpiredisStreamConnection.php
  4. 4 4
      lib/Predis/Connection/RedisCluster.php
  5. 3 4
      lib/Predis/Connection/StreamConnection.php
  6. 2 2
      lib/Predis/Connection/WebdisConnection.php
  7. 4 6
      lib/Predis/Pipeline/MultiExecExecutor.php
  8. 11 10
      lib/Predis/Pipeline/StandardExecutor.php
  9. 2 2
      lib/Predis/Protocol/Text/Handler/ErrorResponse.php
  10. 2 2
      lib/Predis/Protocol/Text/Handler/StatusResponse.php
  11. 2 2
      lib/Predis/Protocol/Text/Handler/StreamableMultiBulkResponse.php
  12. 5 6
      lib/Predis/Protocol/Text/ProtocolProcessor.php
  13. 1 1
      lib/Predis/Response/Error.php
  14. 1 1
      lib/Predis/Response/ErrorInterface.php
  15. 3 3
      lib/Predis/Response/Iterator/MultiBulk.php
  16. 2 2
      lib/Predis/Response/Iterator/MultiBulkIterator.php
  17. 5 5
      lib/Predis/Response/Iterator/MultiBulkTuple.php
  18. 1 1
      lib/Predis/Response/ObjectInterface.php
  19. 5 5
      lib/Predis/Response/ServerException.php
  20. 1 1
      lib/Predis/Response/StatusQueued.php
  21. 5 7
      lib/Predis/Transaction/MultiExecContext.php
  22. 2 2
      tests/PHPUnit/ConnectionTestCase.php
  23. 7 8
      tests/Predis/ClientTest.php
  24. 1 1
      tests/Predis/Command/TransactionDiscardTest.php
  25. 2 2
      tests/Predis/Command/TransactionMultiTest.php
  26. 1 1
      tests/Predis/Command/TransactionUnwatchTest.php
  27. 2 2
      tests/Predis/Command/TransactionWatchTest.php
  28. 1 1
      tests/Predis/Connection/ComposableStreamConnectionTest.php
  29. 5 5
      tests/Predis/Connection/RedisClusterTest.php
  30. 6 8
      tests/Predis/Pipeline/MultiExecExecutorTest.php
  31. 1 1
      tests/Predis/Pipeline/PipelineContextTest.php
  32. 6 7
      tests/Predis/Pipeline/StandardExecutorTest.php
  33. 1 1
      tests/Predis/Protocol/Text/Handler/ErrorResponseTest.php
  34. 0 1
      tests/Predis/Protocol/Text/Handler/IntegerResponseTest.php
  35. 1 2
      tests/Predis/Protocol/Text/Handler/StatusResponseTest.php
  36. 1 1
      tests/Predis/Protocol/Text/Handler/StreamableMultiBulkResponseTest.php
  37. 1 1
      tests/Predis/Protocol/Text/ProtocolProcessorTest.php
  38. 7 7
      tests/Predis/Response/ErrorTest.php
  39. 4 4
      tests/Predis/Response/Iterator/MultiBulkTest.php
  40. 7 7
      tests/Predis/Response/Iterator/MultiBulkTupleTest.php
  41. 5 5
      tests/Predis/Response/ServerExceptionTest.php
  42. 5 5
      tests/Predis/Response/StatusQueuedTest.php
  43. 12 13
      tests/Predis/Transaction/MultiExecContextTest.php

+ 7 - 9
lib/Predis/Client.php

@@ -24,9 +24,7 @@ use Predis\Monitor\MonitorContext;
 use Predis\Pipeline\PipelineContext;
 use Predis\Profile\ServerProfile;
 use Predis\PubSub\PubSubContext;
-use Predis\Response\ResponseErrorInterface;
-use Predis\Response\ResponseObjectInterface;
-use Predis\Response\ServerException;
+use Predis\Response;
 use Predis\Transaction\MultiExecContext;
 
 /**
@@ -283,8 +281,8 @@ class Client implements ClientInterface
     {
         $response = $this->connection->executeCommand($command);
 
-        if ($response instanceof ResponseObjectInterface) {
-            if ($response instanceof ResponseErrorInterface) {
+        if ($response instanceof Response\ObjectInterface) {
+            if ($response instanceof Response\ErrorInterface) {
                 $response = $this->onResponseError($command, $response);
             }
 
@@ -298,10 +296,10 @@ class Client implements ClientInterface
      * Handles -ERR responses returned by Redis.
      *
      * @param CommandInterface $command Redis command that generated the error.
-     * @param ResponseErrorInterface $response Instance of the error response.
+     * @param Response\ErrorInterface $response Instance of the error response.
      * @return mixed
      */
-    protected function onResponseError(CommandInterface $command, ResponseErrorInterface $response)
+    protected function onResponseError(CommandInterface $command, Response\ErrorInterface $response)
     {
         if ($command instanceof ScriptedCommand && $response->getErrorType() === 'NOSCRIPT') {
             $eval = $this->createCommand('eval');
@@ -309,7 +307,7 @@ class Client implements ClientInterface
 
             $response = $this->executeCommand($eval);
 
-            if (!$response instanceof ResponseObjectInterface) {
+            if (!$response instanceof Response\ObjectInterface) {
                 $response = $command->parseResponse($response);
             }
 
@@ -317,7 +315,7 @@ class Client implements ClientInterface
         }
 
         if ($this->options->exceptions) {
-            throw new ServerException($response->getMessage());
+            throw new Response\ServerException($response->getMessage());
         }
 
         return $response;

+ 3 - 4
lib/Predis/Connection/PhpiredisConnection.php

@@ -13,8 +13,7 @@ namespace Predis\Connection;
 
 use Predis\NotSupportedException;
 use Predis\Command\CommandInterface;
-use Predis\Response\ResponseError;
-use Predis\Response\ResponseQueued;
+use Predis\Response;
 
 /**
  * This class provides the implementation of a Predis connection that uses the
@@ -122,7 +121,7 @@ class PhpiredisConnection extends AbstractConnection
                     return true;
 
                 case 'QUEUED':
-                    return new ResponseQueued();
+                    return new Response\StatusQueued();
 
                 default:
                     return $payload;
@@ -139,7 +138,7 @@ class PhpiredisConnection extends AbstractConnection
     private function getErrorHandler()
     {
         return function ($errorMessage) {
-            return new ResponseError($errorMessage);
+            return new Response\Error($errorMessage);
         };
     }
 

+ 3 - 4
lib/Predis/Connection/PhpiredisStreamConnection.php

@@ -13,8 +13,7 @@ namespace Predis\Connection;
 
 use Predis\NotSupportedException;
 use Predis\Command\CommandInterface;
-use Predis\Response\ResponseError;
-use Predis\Response\ResponseQueued;
+use Predis\Response;
 
 /**
  * This class provides the implementation of a Predis connection that uses PHP's
@@ -109,7 +108,7 @@ class PhpiredisStreamConnection extends StreamConnection
                     return true;
 
                 case 'QUEUED':
-                    return new ResponseQueued();
+                    return new Response\StatusQueued();
 
                 default:
                     return $payload;
@@ -126,7 +125,7 @@ class PhpiredisStreamConnection extends StreamConnection
     protected function getErrorHandler()
     {
         return function ($errorMessage) {
-            return new ResponseError($errorMessage);
+            return new Response\Error($errorMessage);
         };
     }
 

+ 4 - 4
lib/Predis/Connection/RedisCluster.php

@@ -16,7 +16,7 @@ use Predis\Cluster\CommandHashStrategyInterface;
 use Predis\NotSupportedException;
 use Predis\Cluster\RedisClusterHashStrategy;
 use Predis\Command\CommandInterface;
-use Predis\Response\ResponseErrorInterface;
+use Predis\Response;
 
 /**
  * Abstraction for Redis cluster (Redis v3.0).
@@ -334,10 +334,10 @@ class RedisCluster implements ClusterConnectionInterface, \IteratorAggregate, \C
      * Handles -ERR replies from Redis.
      *
      * @param CommandInterface $command Command that generated the -ERR reply.
-     * @param ResponseErrorInterface $error Redis error reply object.
+     * @param Response\ErrorInterface $error Redis error reply object.
      * @return mixed
      */
-    protected function handleServerError(CommandInterface $command, ResponseErrorInterface $error)
+    protected function handleServerError(CommandInterface $command, Response\ErrorInterface $error)
     {
         list($type, $details) = explode(' ', $error->getMessage(), 2);
 
@@ -375,7 +375,7 @@ class RedisCluster implements ClusterConnectionInterface, \IteratorAggregate, \C
         $connection = $this->getConnection($command);
         $reply = $connection->executeCommand($command);
 
-        if ($reply instanceof ResponseErrorInterface) {
+        if ($reply instanceof Response\ErrorInterface) {
             return $this->handleServerError($command, $reply);
         }
 

+ 3 - 4
lib/Predis/Connection/StreamConnection.php

@@ -12,8 +12,7 @@
 namespace Predis\Connection;
 
 use Predis\Command\CommandInterface;
-use Predis\Response\ResponseError;
-use Predis\Response\ResponseQueued;
+use Predis\Response;
 
 /**
  * Standard connection to Redis servers implemented on top of PHP's streams.
@@ -190,7 +189,7 @@ class StreamConnection extends AbstractConnection
                         return true;
 
                     case 'QUEUED':
-                        return new ResponseQueued();
+                        return new Response\StatusQueued();
 
                     default:
                         return $payload;
@@ -237,7 +236,7 @@ class StreamConnection extends AbstractConnection
                 return (int) $payload;
 
             case '-':    // error
-                return new ResponseError($payload);
+                return new Response\Error($payload);
 
             default:
                 $this->onProtocolError("Unknown prefix: '$prefix'");

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

@@ -15,7 +15,7 @@ use Predis\NotSupportedException;
 use Predis\Command\CommandInterface;
 use Predis\Connection\ConnectionException;
 use Predis\Protocol\ProtocolException;
-use Predis\Response\ResponseError;
+use Predis\Response;
 
 /**
  * This class implements a Predis connection that actually talks with Webdis
@@ -161,7 +161,7 @@ class WebdisConnection implements SingleConnectionInterface
     protected function getErrorHandler()
     {
         return function ($errorMessage) {
-            return new ResponseError($errorMessage);
+            return new Response\Error($errorMessage);
         };
     }
 

+ 4 - 6
lib/Predis/Pipeline/MultiExecExecutor.php

@@ -17,9 +17,7 @@ use Predis\Connection\ConnectionInterface;
 use Predis\Connection\SingleConnectionInterface;
 use Predis\Profile\ServerProfile;
 use Predis\Profile\ServerProfileInterface;
-use Predis\Response\ResponseErrorInterface;
-use Predis\Response\ResponseObjectInterface;
-use Predis\Response\ServerException;
+use Predis\Response;
 
 /**
  * Implements a pipeline executor that wraps the whole pipeline
@@ -72,11 +70,11 @@ class MultiExecExecutor implements PipelineExecutorInterface
         foreach ($commands as $command) {
             $response = $connection->readResponse($command);
 
-            if ($response instanceof ResponseErrorInterface) {
+            if ($response instanceof Response\ErrorInterface) {
                 $cmd = $this->profile->createCommand('discard');
                 $connection->executeCommand($cmd);
 
-                throw new ServerException($response->getMessage());
+                throw new Response\ServerException($response->getMessage());
             }
         }
 
@@ -110,7 +108,7 @@ class MultiExecExecutor implements PipelineExecutorInterface
             $command = $commands->dequeue();
             $response = $responses[$i];
 
-            if ($response instanceof ResponseObjectInterface) {
+            if ($response instanceof Response\ObjectInterface) {
                 $values[$i] = $response;
             } else {
                 $values[$i] = $command->parseResponse($response);

+ 11 - 10
lib/Predis/Pipeline/StandardExecutor.php

@@ -15,9 +15,7 @@ use SplQueue;
 use Predis\Command\CommandInterface;
 use Predis\Connection\ConnectionInterface;
 use Predis\Connection\ReplicationConnectionInterface;
-use Predis\Response\ResponseErrorInterface;
-use Predis\Response\ResponseObjectInterface;
-use Predis\Response\ServerException;
+use Predis\Response;
 
 /**
  * Implements the standard pipeline executor strategy used
@@ -57,12 +55,15 @@ class StandardExecutor implements PipelineExecutorInterface
      *
      * @param ConnectionInterface $connection
      * @param CommandInterface $command
-     * @param ResponseObjectInterface $response
+     * @param Response\ObjectInterface $response
      * @return mixed
      */
-    protected function onResponseObject(ConnectionInterface $connection, CommandInterface $command, ResponseObjectInterface $response)
+    protected function onResponseObject(
+        ConnectionInterface $connection,
+        CommandInterface $command,
+        Response\ObjectInterface $response)
     {
-        if ($response instanceof ResponseErrorInterface) {
+        if ($response instanceof Response\ErrorInterface) {
             return $this->onResponseError($connection, $response);
         }
 
@@ -73,9 +74,9 @@ class StandardExecutor implements PipelineExecutorInterface
      * Handles -ERR responses returned by Redis.
      *
      * @param ConnectionInterface $connection The connection that returned the error.
-     * @param ResponseErrorInterface $response The error response instance.
+     * @param Response\ErrorInterface $response The error response instance.
      */
-    protected function onResponseError(ConnectionInterface $connection, ResponseErrorInterface $response)
+    protected function onResponseError(ConnectionInterface $connection, Response\ErrorInterface $response)
     {
         if (!$this->exceptions) {
             return $response;
@@ -85,7 +86,7 @@ class StandardExecutor implements PipelineExecutorInterface
         $connection->disconnect();
         $message = $response->getMessage();
 
-        throw new ServerException($message);
+        throw new Response\ServerException($message);
     }
 
     /**
@@ -105,7 +106,7 @@ class StandardExecutor implements PipelineExecutorInterface
             $command = $commands->dequeue();
             $response = $connection->readResponse($command);
 
-            if ($response instanceof ResponseObjectInterface) {
+            if ($response instanceof Response\ObjectInterface) {
                 $values[] = $this->onResponseObject($connection, $command, $response);
             } else {
                 $values[] = $command->parseResponse($response);

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

@@ -12,7 +12,7 @@
 namespace Predis\Protocol\Text\Handler;
 
 use Predis\Connection\ComposableConnectionInterface;
-use Predis\Response\ResponseError;
+use Predis\Response;
 
 /**
  * Handler for the error response type in the standard Redis wire protocol.
@@ -28,6 +28,6 @@ class ErrorResponse implements ResponseHandlerInterface
      */
     public function handle(ComposableConnectionInterface $connection, $payload)
     {
-        return new ResponseError($payload);
+        return new Response\Error($payload);
     }
 }

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

@@ -12,7 +12,7 @@
 namespace Predis\Protocol\Text\Handler;
 
 use Predis\Connection\ComposableConnectionInterface;
-use Predis\Response\ResponseQueued;
+use Predis\Response;
 
 /**
  * Handler for the status response type in the standard Redis wire protocol.
@@ -34,7 +34,7 @@ class StatusResponse implements ResponseHandlerInterface
                 return true;
 
             case 'QUEUED':
-                return new ResponseQueued();
+                return new Response\StatusQueued();
 
             default:
                 return $status;

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

@@ -13,7 +13,7 @@ namespace Predis\Protocol\Text\Handler;
 
 use Predis\CommunicationException;
 use Predis\Connection\ComposableConnectionInterface;
-use Predis\Response\Iterator\MultiBulkResponseSimple;
+use Predis\Response\Iterator\MultiBulk;
 use Predis\Protocol\ProtocolException;
 
 /**
@@ -42,6 +42,6 @@ class StreamableMultiBulkResponse implements ResponseHandlerInterface
             ));
         }
 
-        return new MultiBulkResponseSimple($connection, $length);
+        return new MultiBulk($connection, $length);
     }
 }

+ 5 - 6
lib/Predis/Protocol/Text/ProtocolProcessor.php

@@ -16,9 +16,8 @@ use Predis\Command\CommandInterface;
 use Predis\Connection\ComposableConnectionInterface;
 use Predis\Protocol\ProtocolException;
 use Predis\Protocol\ProtocolProcessorInterface;
-use Predis\Response\ResponseError;
-use Predis\Response\ResponseQueued;
-use Predis\Response\Iterator\MultiBulkResponseSimple;
+use Predis\Response;
+use Predis\Response\Iterator;
 
 /**
  * Protocol processor for the standard Redis wire protocol.
@@ -65,7 +64,7 @@ class ProtocolProcessor implements ProtocolProcessorInterface
                         return true;
 
                     case 'QUEUED':
-                        return new ResponseQueued();
+                        return new Response\StatusQueued();
 
                     default:
                         return $payload;
@@ -85,7 +84,7 @@ class ProtocolProcessor implements ProtocolProcessorInterface
                     return null;
                 }
                 if ($this->mbiterable) {
-                    return new MultiBulkResponseSimple($connection, $count);
+                    return new Iterator\MultiBulk($connection, $count);
                 }
 
                 $multibulk = array();
@@ -100,7 +99,7 @@ class ProtocolProcessor implements ProtocolProcessorInterface
                 return (int) $payload;
 
             case '-':    // error
-                return new ResponseError($payload);
+                return new Response\Error($payload);
 
             default:
                 CommunicationException::handle(new ProtocolException(

+ 1 - 1
lib/Predis/Response/ResponseError.php → lib/Predis/Response/Error.php

@@ -17,7 +17,7 @@ namespace Predis\Response;
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ResponseError implements ResponseErrorInterface
+class Error implements ErrorInterface
 {
     private $message;
 

+ 1 - 1
lib/Predis/Response/ResponseErrorInterface.php → lib/Predis/Response/ErrorInterface.php

@@ -17,7 +17,7 @@ namespace Predis\Response;
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-interface ResponseErrorInterface extends ResponseObjectInterface
+interface ErrorInterface extends ObjectInterface
 {
     /**
      * Returns the error message

+ 3 - 3
lib/Predis/Response/Iterator/MultiBulkResponseSimple.php → lib/Predis/Response/Iterator/MultiBulk.php

@@ -18,7 +18,7 @@ use Predis\Connection\SingleConnectionInterface;
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class MultiBulkResponseSimple extends MultiBulkResponse
+class MultiBulk extends MultiBulkIterator
 {
     private $connection;
 
@@ -79,10 +79,10 @@ class MultiBulkResponseSimple extends MultiBulkResponse
      * Returns an iterator that reads the multi-bulk response as
      * list of tuples.
      *
-     * @return MultiBulkResponseTuple
+     * @return MultiBulkTuple
      */
     public function asTuple()
     {
-        return new MultiBulkResponseTuple($this);
+        return new MultiBulkTuple($this);
     }
 }

+ 2 - 2
lib/Predis/Response/Iterator/MultiBulkResponse.php → lib/Predis/Response/Iterator/MultiBulkIterator.php

@@ -13,7 +13,7 @@ namespace Predis\Response\Iterator;
 
 use Iterator;
 use Countable;
-use Predis\Response\ResponseObjectInterface;
+use Predis\Response;
 
 /**
  * Iterator that abstracts the access to multibulk responses allowing them to be
@@ -27,7 +27,7 @@ use Predis\Response\ResponseObjectInterface;
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-abstract class MultiBulkResponse implements Iterator, Countable, ResponseObjectInterface
+abstract class MultiBulkIterator implements Iterator, Countable, Response\ObjectInterface
 {
     protected $current;
     protected $position;

+ 5 - 5
lib/Predis/Response/Iterator/MultiBulkResponseTuple.php → lib/Predis/Response/Iterator/MultiBulkTuple.php

@@ -24,14 +24,14 @@ use UnexpectedValueException;
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class MultiBulkResponseTuple extends MultiBulkResponse implements OuterIterator
+class MultiBulkTuple extends MultiBulk implements OuterIterator
 {
     private $iterator;
 
     /**
-     * @param MultiBulkResponseSimple $iterator Inner multibulk response iterator.
+     * @param MultiBulk $iterator Inner multibulk response iterator.
      */
-    public function __construct(MultiBulkResponseSimple $iterator)
+    public function __construct(MultiBulk $iterator)
     {
         $this->checkPreconditions($iterator);
 
@@ -44,9 +44,9 @@ class MultiBulkResponseTuple extends MultiBulkResponse implements OuterIterator
     /**
      * Checks for valid preconditions.
      *
-     * @param MultiBulkResponseSimple $iterator Inner multibulk response iterator.
+     * @param MultiBulk $iterator Inner multibulk response iterator.
      */
-    protected function checkPreconditions(MultiBulkResponseSimple $iterator)
+    protected function checkPreconditions(MultiBulk $iterator)
     {
         if ($iterator->getPosition() !== 0) {
             throw new RuntimeException('Cannot initialize a tuple iterator with an already initiated iterator');

+ 1 - 1
lib/Predis/Response/ResponseObjectInterface.php → lib/Predis/Response/ObjectInterface.php

@@ -16,6 +16,6 @@ namespace Predis\Response;
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-interface ResponseObjectInterface
+interface ObjectInterface
 {
 }

+ 5 - 5
lib/Predis/Response/ServerException.php

@@ -18,7 +18,7 @@ use Predis\PredisException;
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ServerException extends PredisException implements ResponseErrorInterface
+class ServerException extends PredisException implements ErrorInterface
 {
     /**
      * Gets the type of the error returned by Redis.
@@ -33,12 +33,12 @@ class ServerException extends PredisException implements ResponseErrorInterface
     }
 
     /**
-     * Converts the exception to an instance of ResponseError.
+     * Converts the exception to an instance of Predis\Response\Error.
      *
-     * @return ResponseError
+     * @return Error
      */
-    public function toResponseError()
+    public function toErrorResponse()
     {
-        return new ResponseError($this->getMessage());
+        return new Error($this->getMessage());
     }
 }

+ 1 - 1
lib/Predis/Response/ResponseQueued.php → lib/Predis/Response/StatusQueued.php

@@ -17,7 +17,7 @@ namespace Predis\Response;
  *
  * @author Daniele Alessandri <suppakilla@gmail.com>
  */
-class ResponseQueued implements ResponseObjectInterface
+class StatusQueued implements ObjectInterface
 {
     /**
      * Converts the object to its string representation.

+ 5 - 7
lib/Predis/Transaction/MultiExecContext.php

@@ -18,9 +18,7 @@ use Predis\ClientInterface;
 use Predis\CommunicationException;
 use Predis\ExecutableContextInterface;
 use Predis\NotSupportedException;
-use Predis\Response\ResponseErrorInterface;
-use Predis\Response\ResponseQueued;
-use Predis\Response\ServerException;
+use Predis\Response;
 use Predis\Command\CommandInterface;
 use Predis\Connection\AggregatedConnectionInterface;
 use Predis\Protocol\ProtocolException;
@@ -212,7 +210,7 @@ class MultiExecContext implements BasicClientInterface, ExecutableContextInterfa
             return $response;
         }
 
-        if (!$response instanceof ResponseQueued) {
+        if (!$response instanceof Response\StatusQueued) {
             $this->onProtocolError('The server did not respond with a QUEUED status reply');
         }
 
@@ -388,9 +386,9 @@ class MultiExecContext implements BasicClientInterface, ExecutableContextInterfa
         for ($i = 0; $i < $size; $i++) {
             $commandReply = $reply[$i];
 
-            if ($commandReply instanceof ResponseErrorInterface && $useExceptions) {
+            if ($commandReply instanceof Response\ErrorInterface && $useExceptions) {
                 $message = $commandReply->getMessage();
-                throw new ServerException($message);
+                throw new Response\ServerException($message);
             }
 
             $values[$i] = $commands->dequeue()->parseResponse($commandReply);
@@ -413,7 +411,7 @@ class MultiExecContext implements BasicClientInterface, ExecutableContextInterfa
             call_user_func($callable, $this);
         } catch (CommunicationException $exception) {
             $blockException = $exception;
-        } catch (ServerException $exception) {
+        } catch (Response\ServerException $exception) {
             $blockException = $exception;
         } catch (\Exception $exception) {
             $blockException = $exception;

+ 2 - 2
tests/PHPUnit/ConnectionTestCase.php

@@ -219,7 +219,7 @@ abstract class ConnectionTestCase extends StandardTestCase
         $connection->writeCommand($profile->createCommand('multi'));
         $connection->writeCommand($profile->createCommand('ping'));
         $this->assertTrue($connection->read());
-        $this->assertInstanceOf('Predis\Response\ResponseQueued', $connection->read());
+        $this->assertInstanceOf('Predis\Response\StatusQueued', $connection->read());
     }
 
     /**
@@ -261,7 +261,7 @@ abstract class ConnectionTestCase extends StandardTestCase
         $connection->executeCommand($profile->createCommand('set', array('foo', 'bar')));
         $connection->writeCommand($profile->createCommand('rpush', array('foo', 'baz')));
 
-        $this->assertInstanceOf('Predis\Response\ResponseError', $error = $connection->read());
+        $this->assertInstanceOf('Predis\Response\Error', $error = $connection->read());
         $this->assertRegExp('/[ERR|WRONGTYPE] Operation against a key holding the wrong kind of value/', $error->getMessage());
     }
 

+ 7 - 8
tests/Predis/ClientTest.php

@@ -17,8 +17,7 @@ use Predis\Connection\ConnectionFactory;
 use Predis\Connection\MasterSlaveReplication;
 use Predis\Connection\PredisCluster;
 use Predis\Profile\ServerProfile;
-use Predis\Response\ResponseError;
-use Predis\Response\ResponseQueued;
+use Predis\Response;
 
 /**
  *
@@ -406,7 +405,7 @@ class ClientTest extends StandardTestCase
     public function testExecuteCommandThrowsExceptionOnRedisError()
     {
         $ping = ServerProfile::getDefault()->createCommand('ping', array());
-        $expectedResponse = new ResponseError('ERR Operation against a key holding the wrong kind of value');
+        $expectedResponse = new Response\Error('ERR Operation against a key holding the wrong kind of value');
 
         $connection= $this->getMock('Predis\Connection\ConnectionInterface');
         $connection->expects($this->once())
@@ -423,7 +422,7 @@ class ClientTest extends StandardTestCase
     public function testExecuteCommandReturnsErrorResponseOnRedisError()
     {
         $ping = ServerProfile::getDefault()->createCommand('ping', array());
-        $expectedResponse = new ResponseError('ERR Operation against a key holding the wrong kind of value');
+        $expectedResponse = new Response\Error('ERR Operation against a key holding the wrong kind of value');
 
         $connection= $this->getMock('Predis\Connection\ConnectionInterface');
         $connection->expects($this->once())
@@ -468,7 +467,7 @@ class ClientTest extends StandardTestCase
      */
     public function testCallingRedisCommandThrowsExceptionOnServerError()
     {
-        $expectedResponse = new ResponseError('ERR Operation against a key holding the wrong kind of value');
+        $expectedResponse = new Response\Error('ERR Operation against a key holding the wrong kind of value');
 
         $connection = $this->getMock('Predis\Connection\ConnectionInterface');
         $connection->expects($this->once())
@@ -485,7 +484,7 @@ class ClientTest extends StandardTestCase
      */
     public function testCallingRedisCommandReturnsErrorResponseOnRedisError()
     {
-        $expectedResponse = new ResponseError('ERR Operation against a key holding the wrong kind of value');
+        $expectedResponse = new Response\Error('ERR Operation against a key holding the wrong kind of value');
 
         $connection = $this->getMock('Predis\Connection\ConnectionInterface');
         $connection->expects($this->once())
@@ -725,7 +724,7 @@ class ClientTest extends StandardTestCase
         $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
         $connection->expects($this->once())
                    ->method('executeCommand')
-                   ->will($this->returnValue(new ResponseQueued()));
+                   ->will($this->returnValue(new Response\StatusQueued()));
 
         $txCallback = function ($tx) {
             $tx->ping();
@@ -769,7 +768,7 @@ class ClientTest extends StandardTestCase
         $connection->expects($this->at(0))
                    ->method('executeCommand')
                    ->with($command)
-                   ->will($this->returnValue(new ResponseError('NOSCRIPT')));
+                   ->will($this->returnValue(new Response\Error('NOSCRIPT')));
         $connection->expects($this->at(1))
                    ->method('executeCommand')
                    ->with($this->isInstanceOf('Predis\Command\ServerEval'))

+ 1 - 1
tests/Predis/Command/TransactionDiscardTest.php

@@ -63,7 +63,7 @@ class TransactionDiscardTest extends CommandTestCase
 
         $redis->multi();
 
-        $this->assertInstanceOf('Predis\Response\ResponseQueued', $redis->set('foo', 'bar'));
+        $this->assertInstanceOf('Predis\Response\StatusQueued', $redis->set('foo', 'bar'));
         $this->assertTrue($redis->discard());
         $this->assertFalse($redis->exists('foo'));
     }

+ 2 - 2
tests/Predis/Command/TransactionMultiTest.php

@@ -74,8 +74,8 @@ class TransactionMultiTest extends CommandTestCase
         $redis = $this->getClient();
 
         $this->assertTrue($redis->multi());
-        $this->assertInstanceOf('Predis\Response\ResponseObjectInterface', $redis->echo('tx1'));
-        $this->assertInstanceOf('Predis\Response\ResponseQueued', $redis->echo('tx2'));
+        $this->assertInstanceOf('Predis\Response\ObjectInterface', $redis->echo('tx1'));
+        $this->assertInstanceOf('Predis\Response\StatusQueued', $redis->echo('tx2'));
     }
 
     /**

+ 1 - 1
tests/Predis/Command/TransactionUnwatchTest.php

@@ -81,6 +81,6 @@ class TransactionUnwatchTest extends CommandTestCase
         $redis = $this->getClient();
 
         $redis->multi();
-        $this->assertInstanceOf('Predis\Response\ResponseQueued', $redis->unwatch());
+        $this->assertInstanceOf('Predis\Response\StatusQueued', $redis->unwatch());
     }
 }

+ 2 - 2
tests/Predis/Command/TransactionWatchTest.php

@@ -108,7 +108,7 @@ class TransactionWatchTest extends CommandTestCase
 
         $this->assertTrue($redis1->watch('foo', 'hoge'));
         $this->assertTrue($redis1->multi());
-        $this->assertInstanceOf('Predis\Response\ResponseQueued', $redis1->get('foo'));
+        $this->assertInstanceOf('Predis\Response\StatusQueued', $redis1->get('foo'));
         $this->assertTrue($redis2->set('foo', 'hijacked'));
         $this->assertNull($redis1->exec());
         $this->assertSame('hijacked', $redis1->get('foo'));
@@ -124,7 +124,7 @@ class TransactionWatchTest extends CommandTestCase
 
         $this->assertTrue($redis1->watch('foo'));
         $this->assertTrue($redis1->multi());
-        $this->assertInstanceOf('Predis\Response\ResponseQueued', $redis1->set('foo', 'bar'));
+        $this->assertInstanceOf('Predis\Response\StatusQueued', $redis1->set('foo', 'bar'));
         $this->assertTrue($redis2->set('foo', 'hijacked'));
         $this->assertNull($redis1->exec());
         $this->assertSame('hijacked', $redis1->get('foo'));

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

@@ -80,7 +80,7 @@ class ComposableStreamConnectionTest extends ConnectionTestCase
         $connection->executeCommand($profile->createCommand('rpush', array('metavars', 'foo', 'hoge', 'lol')));
         $connection->writeCommand($profile->createCommand('lrange', array('metavars', 0, -1)));
 
-        $this->assertInstanceOf('Predis\Response\Iterator\MultiBulkResponse', $iterator = $connection->read());
+        $this->assertInstanceOf('Predis\Response\Iterator\MultiBulkIterator', $iterator = $connection->read());
         $this->assertSame(array('foo', 'hoge', 'lol'), iterator_to_array($iterator));
     }
 

+ 5 - 5
tests/Predis/Connection/RedisClusterTest.php

@@ -14,7 +14,7 @@ namespace Predis\Connection;
 use \PHPUnit_Framework_TestCase as StandardTestCase;
 
 use Predis\Profile\ServerProfile;
-use Predis\Response\ResponseError;
+use Predis\Response;
 
 /**
  *
@@ -423,7 +423,7 @@ class RedisClusterTest extends StandardTestCase
      */
     public function testAskResponseWithConnectionInPool()
     {
-        $askResponse = new ResponseError('ASK 1970 127.0.0.1:6380');
+        $askResponse = new Response\Error('ASK 1970 127.0.0.1:6380');
 
         $command = ServerProfile::getDefault()->createCommand('get', array('node:1001'));
 
@@ -456,7 +456,7 @@ class RedisClusterTest extends StandardTestCase
      */
     public function testAskResponseWithConnectionNotInPool()
     {
-        $askResponse = new ResponseError('ASK 1970 127.0.0.1:6381');
+        $askResponse = new Response\Error('ASK 1970 127.0.0.1:6381');
 
         $command = ServerProfile::getDefault()->createCommand('get', array('node:1001'));
 
@@ -496,7 +496,7 @@ class RedisClusterTest extends StandardTestCase
      */
     public function testMovedResponseWithConnectionInPool()
     {
-        $movedResponse = new ResponseError('MOVED 1970 127.0.0.1:6380');
+        $movedResponse = new Response\Error('MOVED 1970 127.0.0.1:6380');
 
         $command = ServerProfile::getDefault()->createCommand('get', array('node:1001'));
 
@@ -530,7 +530,7 @@ class RedisClusterTest extends StandardTestCase
      */
     public function testMovedResponseWithConnectionNotInPool()
     {
-        $movedResponse = new ResponseError('MOVED 1970 127.0.0.1:6381');
+        $movedResponse = new Response\Error('MOVED 1970 127.0.0.1:6381');
 
         $command = ServerProfile::getDefault()->createCommand('get', array('node:1001'));
 

+ 6 - 8
tests/Predis/Pipeline/MultiExecExecutorTest.php

@@ -15,9 +15,7 @@ use \PHPUnit_Framework_TestCase as StandardTestCase;
 
 use SplQueue;
 use Predis\Profile\ServerProfile;
-use Predis\Response\ResponseError;
-use Predis\Response\ResponseObjectInterface;
-use Predis\Response\ResponseQueued;
+use Predis\Response;
 
 /**
  *
@@ -31,7 +29,7 @@ class MultiExecExecutorTest extends StandardTestCase
     {
         $executor = new MultiExecExecutor();
         $pipeline = $this->getCommandsQueue();
-        $queued = new ResponseQueued();
+        $queued = new Response\StatusQueued();
 
         $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
         $connection->expects($this->exactly(2))
@@ -76,8 +74,8 @@ class MultiExecExecutorTest extends StandardTestCase
     {
         $executor = new MultiExecExecutor();
         $pipeline = $this->getCommandsQueue();
-        $queued = new ResponseQueued();
-        $error = new ResponseError('ERR Test error');
+        $queued = new Response\StatusQueued();
+        $error = new Response\Error('ERR Test error');
 
         $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
         $connection->expects($this->at(0))
@@ -100,8 +98,8 @@ class MultiExecExecutorTest extends StandardTestCase
     {
         $executor = new MultiExecExecutor();
         $pipeline = $this->getCommandsQueue();
-        $queued = new ResponseQueued();
-        $error = new ResponseError('ERR Test error');
+        $queued = new Response\StatusQueued();
+        $error = new Response\Error('ERR Test error');
 
         $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
         $connection->expects($this->exactly(3))

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

@@ -377,7 +377,7 @@ class PipelineContextTest extends StandardTestCase
         });
 
         $this->assertTrue($results[0]);
-        $this->assertInstanceOf('Predis\Response\ResponseError', $results[1]);
+        $this->assertInstanceOf('Predis\Response\Error', $results[1]);
         $this->assertSame('bar', $results[2]);
     }
 

+ 6 - 7
tests/Predis/Pipeline/StandardExecutorTest.php

@@ -15,8 +15,7 @@ use \PHPUnit_Framework_TestCase as StandardTestCase;
 
 use SplQueue;
 use Predis\Profile\ServerProfile;
-use Predis\Response\ResponseError;
-use Predis\Response\ResponseObjectInterface;
+use Predis\Response;
 
 /**
  *
@@ -74,7 +73,7 @@ class StandardExecutorTest extends StandardTestCase
     public function testExecutorDoesNotParseResponseObjects()
     {
         $executor = new StandardExecutor();
-        $response = $this->getMock('Predis\Response\ResponseObjectInterface');
+        $response = $this->getMock('Predis\Response\ObjectInterface');
 
         $this->simpleResponseObjectTest($executor, $response);
     }
@@ -85,7 +84,7 @@ class StandardExecutorTest extends StandardTestCase
     public function testExecutorCanReturnRedisErrors()
     {
         $executor = new StandardExecutor(false);
-        $response = $this->getMock('Predis\Response\ResponseErrorInterface');
+        $response = $this->getMock('Predis\Response\ErrorInterface');
 
         $this->simpleResponseObjectTest($executor, $response);
     }
@@ -99,7 +98,7 @@ class StandardExecutorTest extends StandardTestCase
     {
         $executor = new StandardExecutor(true);
         $pipeline = $this->getCommandsQueue();
-        $error = new ResponseError('ERR Test error');
+        $error = new Response\Error('ERR Test error');
 
         $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
         $connection->expects($this->once())
@@ -114,12 +113,12 @@ class StandardExecutorTest extends StandardTestCase
     // ******************************************************************** //
 
     /**
-     * Executes a test for the Predis\Response\ResponseObjectInterface type.
+     * Executes a test for the Predis\Response\ObjectInterface type.
      *
      * @param PipelineExecutorInterface $executor
      * @param ResponseObjectInterface $response
      */
-    protected function simpleResponseObjectTest(PipelineExecutorInterface $executor, ResponseObjectInterface $response)
+    protected function simpleResponseObjectTest(PipelineExecutorInterface $executor, Response\ObjectInterface $response)
     {
         $pipeline = new SplQueue();
 

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

@@ -33,7 +33,7 @@ class ErrorResponseTest extends StandardTestCase
         $message = "ERR Operation against a key holding the wrong kind of value";
         $response = $handler->handle($connection, $message);
 
-        $this->assertInstanceOf('Predis\Response\ResponseError', $response);
+        $this->assertInstanceOf('Predis\Response\Error', $response);
         $this->assertSame($message, $response->getMessage());
     }
 }

+ 0 - 1
tests/Predis/Protocol/Text/Handler/IntegerResponseTest.php

@@ -12,7 +12,6 @@
 namespace Predis\Protocol\Text;
 
 use \PHPUnit_Framework_TestCase as StandardTestCase;
-use Predis\Response\ResponseQueued;
 
 /**
  *

+ 1 - 2
tests/Predis/Protocol/Text/Handler/StatusResponseTest.php

@@ -12,7 +12,6 @@
 namespace Predis\Protocol\Text;
 
 use \PHPUnit_Framework_TestCase as StandardTestCase;
-use Predis\Response\ResponseQueued;
 
 /**
  *
@@ -46,7 +45,7 @@ class StatusResponseTest extends StandardTestCase
         $connection->expects($this->never())->method('readLine');
         $connection->expects($this->never())->method('readBytes');
 
-        $this->assertInstanceOf('Predis\Response\ResponseQueued', $handler->handle($connection, 'QUEUED'));
+        $this->assertInstanceOf('Predis\Response\StatusQueued', $handler->handle($connection, 'QUEUED'));
     }
 
     /**

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

@@ -30,7 +30,7 @@ class StreamableMultiBulkResponseTest extends StandardTestCase
         $connection->expects($this->never())->method('readLine');
         $connection->expects($this->never())->method('readBytes');
 
-        $this->assertInstanceOf('Predis\Response\Iterator\MultiBulkResponseSimple', $handler->handle($connection, '1'));
+        $this->assertInstanceOf('Predis\Response\Iterator\MultiBulk', $handler->handle($connection, '1'));
     }
 
     /**

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

@@ -97,7 +97,7 @@ class ProtocolProcessorTest extends StandardTestCase
                    ->method('readLine')
                    ->will($this->returnValue("*1"));
 
-        $this->assertInstanceOf('Predis\Response\Iterator\MultiBulkResponseSimple', $protocol->read($connection));
+        $this->assertInstanceOf('Predis\Response\Iterator\MultiBulk', $protocol->read($connection));
     }
 
     /**

+ 7 - 7
tests/Predis/Response/ResponseErrorTest.php → tests/Predis/Response/ErrorTest.php

@@ -16,7 +16,7 @@ use \PHPUnit_Framework_TestCase as StandardTestCase;
 /**
  *
  */
-class ResponseErrorTest extends StandardTestCase
+class ErrorTest extends StandardTestCase
 {
     const ERR_WRONG_KEY_TYPE = 'ERR Operation against a key holding the wrong kind of value';
 
@@ -25,10 +25,10 @@ class ResponseErrorTest extends StandardTestCase
      */
     public function testResponseErrorClass()
     {
-        $error = new ResponseError(self::ERR_WRONG_KEY_TYPE);
+        $error = new Error(self::ERR_WRONG_KEY_TYPE);
 
-        $this->assertInstanceOf('Predis\Response\ResponseErrorInterface', $error);
-        $this->assertInstanceOf('Predis\Response\ResponseObjectInterface', $error);
+        $this->assertInstanceOf('Predis\Response\ErrorInterface', $error);
+        $this->assertInstanceOf('Predis\Response\ObjectInterface', $error);
     }
 
     /**
@@ -36,7 +36,7 @@ class ResponseErrorTest extends StandardTestCase
      */
     public function testErrorMessage()
     {
-        $error = new ResponseError(self::ERR_WRONG_KEY_TYPE);
+        $error = new Error(self::ERR_WRONG_KEY_TYPE);
 
         $this->assertEquals(self::ERR_WRONG_KEY_TYPE, $error->getMessage());
     }
@@ -46,7 +46,7 @@ class ResponseErrorTest extends StandardTestCase
      */
     public function testErrorType()
     {
-        $exception = new ResponseError(self::ERR_WRONG_KEY_TYPE);
+        $exception = new Error(self::ERR_WRONG_KEY_TYPE);
 
         $this->assertEquals('ERR', $exception->getErrorType());
     }
@@ -56,7 +56,7 @@ class ResponseErrorTest extends StandardTestCase
      */
     public function testToString()
     {
-        $error = new ResponseError(self::ERR_WRONG_KEY_TYPE);
+        $error = new Error(self::ERR_WRONG_KEY_TYPE);
 
         $this->assertEquals(self::ERR_WRONG_KEY_TYPE, (string) $error);
     }

+ 4 - 4
tests/Predis/Response/Iterator/MultiBulkResponseSimpleTest.php → tests/Predis/Response/Iterator/MultiBulkTest.php

@@ -21,7 +21,7 @@ use Predis\Protocol\Text\ProtocolProcessor as TextProtocolProcessor;
 /**
  * @group realm-iterators
  */
-class MultiBulkResponseSimpleTest extends StandardTestCase
+class MultiBulkTest extends StandardTestCase
 {
     /**
      * @group connected
@@ -32,7 +32,7 @@ class MultiBulkResponseSimpleTest extends StandardTestCase
         $client->rpush('metavars', 'foo', 'hoge', 'lol');
 
         $this->assertInstanceOf('Iterator', $iterator = $client->lrange('metavars', 0, -1));
-        $this->assertInstanceOf('Predis\Response\Iterator\MultiBulkResponseSimple', $iterator);
+        $this->assertInstanceOf('Predis\Response\Iterator\MultiBulk', $iterator);
         $this->assertTrue($iterator->valid());
         $this->assertSame(3, $iterator->count());
 
@@ -59,8 +59,8 @@ class MultiBulkResponseSimpleTest extends StandardTestCase
         $client = $this->getClient();
         $client->mset('foo', 'bar', 'hoge', 'piyo');
 
-        $this->assertInstanceOf('Predis\Response\Iterator\MultiBulkResponseSimple', $iterator = $client->mget('foo', 'bar'));
-        $this->assertInstanceOf('Predis\Response\Iterator\MultiBulkResponseTuple', $iterator->asTuple());
+        $this->assertInstanceOf('Predis\Response\Iterator\MultiBulk', $iterator = $client->mget('foo', 'bar'));
+        $this->assertInstanceOf('Predis\Response\Iterator\MultiBulkTuple', $iterator->asTuple());
     }
 
     /**

+ 7 - 7
tests/Predis/Response/Iterator/MultiBulkResponseTupleTest.php → tests/Predis/Response/Iterator/MultiBulkTupleTest.php

@@ -21,7 +21,7 @@ use Predis\Protocol\Text\ProtocolProcessor as TextProtocolProcessor;
 /**
  * @group realm-iterators
  */
-class MultiBulkResponseTupleTest extends StandardTestCase
+class MultiBulkTupleTest extends StandardTestCase
 {
     /**
      * @group disconnected
@@ -31,10 +31,10 @@ class MultiBulkResponseTupleTest extends StandardTestCase
     public function testInitiatedMultiBulkIteratorsAreNotValid()
     {
         $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
-        $iterator = new MultiBulkResponseSimple($connection, 2);
+        $iterator = new MultiBulk($connection, 2);
         $iterator->next();
 
-        new MultiBulkResponseTuple($iterator);
+        new MultiBulkTuple($iterator);
     }
 
     /**
@@ -45,9 +45,9 @@ class MultiBulkResponseTupleTest extends StandardTestCase
     public function testMultiBulkWithOddSizesAreInvalid()
     {
         $connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
-        $iterator = new MultiBulkResponseSimple($connection, 3);
+        $iterator = new MultiBulk($connection, 3);
 
-        new MultiBulkResponseTuple($iterator);
+        new MultiBulkTuple($iterator);
     }
 
     /**
@@ -59,8 +59,8 @@ class MultiBulkResponseTupleTest extends StandardTestCase
         $client->zadd('metavars', 1, 'foo', 2, 'hoge', 3, 'lol');
 
         $this->assertInstanceOf('OuterIterator', $iterator = $client->zrange('metavars', 0, -1, 'withscores')->asTuple());
-        $this->assertInstanceOf('Predis\Response\Iterator\MultiBulkResponseTuple', $iterator);
-        $this->assertInstanceOf('Predis\Response\Iterator\MultiBulkResponseSimple', $iterator->getInnerIterator());
+        $this->assertInstanceOf('Predis\Response\Iterator\MultiBulkTuple', $iterator);
+        $this->assertInstanceOf('Predis\Response\Iterator\MultiBulk', $iterator->getInnerIterator());
         $this->assertTrue($iterator->valid());
         $this->assertSame(3, $iterator->count());
 

+ 5 - 5
tests/Predis/Response/ServerExceptionTest.php

@@ -38,8 +38,8 @@ class ServerExceptionTest extends StandardTestCase
         $exception = new ServerException(self::ERR_WRONG_KEY_TYPE);
 
         $this->assertInstanceOf('Predis\Response\ServerException', $exception);
-        $this->assertInstanceOf('Predis\Response\ResponseErrorInterface', $exception);
-        $this->assertInstanceOf('Predis\Response\ResponseObjectInterface', $exception);
+        $this->assertInstanceOf('Predis\Response\ErrorInterface', $exception);
+        $this->assertInstanceOf('Predis\Response\ObjectInterface', $exception);
         $this->assertInstanceOf('Predis\PredisException', $exception);
     }
 
@@ -56,12 +56,12 @@ class ServerExceptionTest extends StandardTestCase
     /**
      * @group disconnected
      */
-    public function testToResponseError()
+    public function testToErrorResponse()
     {
         $exception = new ServerException(self::ERR_WRONG_KEY_TYPE);
-        $error = $exception->toResponseError();
+        $error = $exception->toErrorResponse();
 
-        $this->assertInstanceOf('Predis\Response\ResponseError', $error);
+        $this->assertInstanceOf('Predis\Response\Error', $error);
 
         $this->assertEquals($exception->getMessage(), $error->getMessage());
         $this->assertEquals($exception->getErrorType(), $error->getErrorType());

+ 5 - 5
tests/Predis/Response/ResponseQueuedTest.php → tests/Predis/Response/StatusQueuedTest.php

@@ -16,16 +16,16 @@ use \PHPUnit_Framework_TestCase as StandardTestCase;
 /**
  *
  */
-class ResponseQueuedTest extends StandardTestCase
+class StatusQueuedTest extends StandardTestCase
 {
     /**
      * @group disconnected
      */
     public function testResponseQueuedClass()
     {
-        $queued = new ResponseQueued();
+        $queued = new StatusQueued();
 
-        $this->assertInstanceOf('Predis\Response\ResponseObjectInterface', $queued);
+        $this->assertInstanceOf('Predis\Response\ObjectInterface', $queued);
     }
 
     /**
@@ -33,7 +33,7 @@ class ResponseQueuedTest extends StandardTestCase
      */
     public function testToString()
     {
-        $queued = new ResponseQueued();
+        $queued = new StatusQueued();
 
         $this->assertEquals('QUEUED', (string) $queued);
     }
@@ -43,7 +43,7 @@ class ResponseQueuedTest extends StandardTestCase
      */
     public function testQueuedProperty()
     {
-        $queued = new ResponseQueued();
+        $queued = new StatusQueued();
 
         $this->assertTrue(isset($queued->queued));
         $this->assertTrue($queued->queued);

+ 12 - 13
tests/Predis/Transaction/MultiExecContextTest.php

@@ -15,8 +15,7 @@ use \PHPUnit_Framework_TestCase as StandardTestCase;
 
 use Predis\Client;
 use Predis\Command\CommandInterface;
-use Predis\Response\ResponseQueued;
-use Predis\Response\ServerException;
+use Predis\Response;
 
 /**
  * @group realm-transaction
@@ -462,7 +461,7 @@ class MultiExecContextTest extends StandardTestCase
                 $tx->echo('ERR Invalid operation');
                 $tx->get('foo');
             });
-        } catch (ServerException $ex) {
+        } catch (Response\ServerException $ex) {
             $tx->discard();
         }
 
@@ -510,11 +509,11 @@ class MultiExecContextTest extends StandardTestCase
                 $tx->lpush('foo', 'bar');
                 $tx->set('foo', $value);
             });
-        } catch (ServerException $ex) {
+        } catch (Response\ServerException $ex) {
             $exception = $ex;
         }
 
-        $this->assertInstanceOf('Predis\Response\ResponseErrorInterface', $exception);
+        $this->assertInstanceOf('Predis\Response\ErrorInterface', $exception);
         $this->assertSame($value, $client->get('foo'));
     }
 
@@ -532,7 +531,7 @@ class MultiExecContextTest extends StandardTestCase
         });
 
         $this->assertTrue($replies[0]);
-        $this->assertInstanceOf('Predis\Response\ResponseErrorInterface', $replies[1]);
+        $this->assertInstanceOf('Predis\Response\ErrorInterface', $replies[1]);
         $this->assertSame('foobar', $replies[2]);
     }
 
@@ -685,21 +684,21 @@ class MultiExecContextTest extends StandardTestCase
             switch ($cmd) {
                 case 'WATCH':
                     if ($multi) {
-                        throw new ServerException("ERR $cmd inside MULTI is not allowed");
+                        throw new Response\ServerException("ERR $cmd inside MULTI is not allowed");
                     }
 
                     return $watch = true;
 
                 case 'MULTI':
                     if ($multi) {
-                        throw new ServerException("ERR MULTI calls can not be nested");
+                        throw new Response\ServerException("ERR MULTI calls can not be nested");
                     }
 
                     return $multi = true;
 
                 case 'EXEC':
                     if (!$multi) {
-                        throw new ServerException("ERR $cmd without MULTI");
+                        throw new Response\ServerException("ERR $cmd without MULTI");
                     }
 
                     $watch = $multi = false;
@@ -714,7 +713,7 @@ class MultiExecContextTest extends StandardTestCase
 
                 case 'DISCARD':
                     if (!$multi) {
-                        throw new ServerException("ERR $cmd without MULTI");
+                        throw new Response\ServerException("ERR $cmd without MULTI");
                     }
 
                     $watch = $multi = false;
@@ -724,20 +723,20 @@ class MultiExecContextTest extends StandardTestCase
                 case 'ECHO':
                     @list($trigger) = $command->getArguments();
                     if (strpos($trigger, 'ERR ') === 0) {
-                        throw new ServerException($trigger);
+                        throw new Response\ServerException($trigger);
                     }
 
                     if ($trigger === '!!ABORT!!' && $multi) {
                         $abort = true;
                     }
 
-                    return new ResponseQueued();
+                    return new Response\StatusQueued();
 
                 case 'UNWATCH':
                     $watch = false;
 
                 default:
-                    return $multi ? new ResponseQueued() : 'DUMMY_REPLY';
+                    return $multi ? new Response\StatusQueued() : 'DUMMY_REPLY';
             }
         };
     }