You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.1 KiB

  1. <?php
  2. /*
  3. * @copyright NetMonsters <team@netmonsters.ru>
  4. * @link http://netmonsters.ru
  5. * @package Majestic
  6. * @subpackage UnitTests
  7. * @since 2011-10-11
  8. *
  9. * Unit tests for Error404Exception class
  10. */
  11. require_once dirname(__FILE__) . '/../../exception/GeneralException.php';
  12. require_once dirname(__FILE__) . '/../../exception/ErrorHTTPException.php';
  13. require_once dirname(__FILE__) . '/../../exception/Error404Exception.php';
  14. class Error404ExceptionTest extends PHPUnit_Framework_TestCase
  15. {
  16. public function testError404Exception()
  17. {
  18. $this->setExpectedException('Error404Exception', 404);
  19. throw new Error404Exception();
  20. }
  21. public function testError404ExceptionMessage()
  22. {
  23. $this->setExpectedException('Error404Exception', 'Error404Exception message', 404);
  24. throw new Error404Exception('Error404Exception message', 10);
  25. }
  26. public function testError404ExceptionWithPrevious()
  27. {
  28. $this->setExpectedException('Error404Exception', 'Error404Exception message', 404);
  29. throw new Error404Exception('Error404Exception message', 10, new ErrorException('Error message'));
  30. }
  31. }