Skip to content

Commit

Permalink
Adding cases for Error404 and Error500 exceptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Sep 2, 2010
1 parent a1e01e4 commit 29ade86
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions cake/tests/cases/console/console_error_handler.test.php
Expand Up @@ -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.