mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Adding cases for Error404 and Error500 exceptions.
This commit is contained in:
parent
a1e01e414b
commit
29ade860b1
1 changed files with 30 additions and 0 deletions
|
@ -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]);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue