Add the Predis\IReplyObject interface (used to mark returned objects that must skip reply parsing).

This commit is contained in:
Daniele Alessandri
2011-05-21 11:04:15 +02:00
parent deeb58644a
commit 2012963ed0
7 changed files with 34 additions and 34 deletions
+6 -4
View File
@@ -157,7 +157,7 @@ class ClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
function testResponseQueued() {
$response = new \Predis\ResponseQueued();
$this->assertTrue($response->queued);
$this->assertInstanceOf('\Predis\IReplyObject', $response);
$this->assertEquals(\Predis\Protocols\Text\TextProtocol::QUEUED, (string)$response);
}
@@ -168,8 +168,10 @@ class ClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
$errorMessage = 'ERROR MESSAGE';
$response = new \Predis\ResponseError($errorMessage);
$this->assertTrue($response->error);
$this->assertEquals($errorMessage, $response->message);
$this->assertInstanceOf('\Predis\IReplyObject', $response);
$this->assertInstanceOf('\Predis\IRedisServerError', $response);
$this->assertEquals($errorMessage, $response->getMessage());
$this->assertEquals($errorMessage, (string)$response);
}
@@ -309,7 +311,7 @@ class ClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
$connection->writeBytes($rawCmdUnexpected);
$errorReply = $reader->read($connection);
$this->assertInstanceOf('\Predis\ResponseError', $errorReply);
$this->assertEquals(RC::EXCEPTION_WRONG_TYPE, $errorReply->message);
$this->assertEquals(RC::EXCEPTION_WRONG_TYPE, $errorReply->getMessage());
$reader->setHandler(
\Predis\Protocols\Text\TextProtocol::PREFIX_ERROR,