123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- namespace Predis;
- use \PHPUnit_Framework_TestCase as StandardTestCase;
- class ResponseErrorTest extends StandardTestCase
- {
- const ERR_WRONG_KEY_TYPE = 'ERR Operation against a key holding the wrong kind of value';
-
- public function testResponseErrorClass()
- {
- $error = new ResponseError(self::ERR_WRONG_KEY_TYPE);
- $this->assertInstanceOf('Predis\IRedisServerError', $error);
- $this->assertInstanceOf('Predis\IReplyObject', $error);
- }
-
- public function testErrorMessage()
- {
- $error = new ResponseError(self::ERR_WRONG_KEY_TYPE);
- $this->assertEquals(self::ERR_WRONG_KEY_TYPE, $error->getMessage());
- }
-
- public function testErrorType()
- {
- $exception = new ResponseError(self::ERR_WRONG_KEY_TYPE);
- $this->assertEquals('ERR', $exception->getErrorType());
- }
-
- public function testToString()
- {
- $error = new ResponseError(self::ERR_WRONG_KEY_TYPE);
- $this->assertEquals(self::ERR_WRONG_KEY_TYPE, (string) $error);
- }
- }
|