ClientExceptionTest.php 897 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /*
  3. * This file is part of the Predis package.
  4. *
  5. * (c) Daniele Alessandri <suppakilla@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Predis;
  11. use PredisTestCase;
  12. /**
  13. *
  14. */
  15. class ClientExceptionTest extends PredisTestCase
  16. {
  17. /**
  18. * @group disconnected
  19. */
  20. public function testExceptionMessage()
  21. {
  22. $message = 'This is a client exception.';
  23. $this->setExpectedException('Predis\ClientException', $message);
  24. throw new ClientException($message);
  25. }
  26. /**
  27. * @group disconnected
  28. */
  29. public function testExceptionClass()
  30. {
  31. $exception = new ClientException();
  32. $this->assertInstanceOf('Predis\ClientException', $exception);
  33. $this->assertInstanceOf('Predis\PredisException', $exception);
  34. }
  35. }