Skip to content
Permalink
Browse files

Adding cases for Error404 and Error500 exceptions.

  • Loading branch information...
markstory committed Sep 2, 2010
1 parent a1e01e4 commit 29ade860b117f55d3e72f183ea6b597dd79e03ff
Showing with 30 additions and 0 deletions.
  1. +30 −0 cake/tests/cases/console/console_error_handler.test.php
@@ -70,4 +70,34 @@ function testNonCakeExceptions() {
$this->assertEquals(1, count($result));
$this->assertEquals('Too many parameters.', $result[0]);
}
/**
* test a Error404 exception.
*
* @return void
*/
function testError404Exception() {
$exception = new Error404Exception('dont use me in cli.');
$error = new TestConsoleErrorHandler($exception);
$error->render();
$result = $error->output;
$this->assertEquals(1, count($result));
$this->assertEquals('dont use me in cli.', $result[0]);
}
/**
* test a Error500 exception.
*
* @return void
*/
function testError500Exception() {
$exception = new Error500Exception('dont use me in cli.');
$error = new TestConsoleErrorHandler($exception);
$error->render();
$result = $error->output;
$this->assertEquals(1, count($result));
$this->assertEquals('dont use me in cli.', $result[0]);
}
}

0 comments on commit 29ade86

Please sign in to comment.
You can’t perform that action at this time.