Adding cases for Error404 and Error500 exceptions.

This commit is contained in:
Mark Story 2010-09-02 18:04:50 -04:00
parent a1e01e414b
commit 29ade860b1

View file

@ -70,4 +70,34 @@ class ConsoleErrorHandlerTest extends CakeTestCase {
$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]);
}
}