Skip to content

Commit

Permalink
Fixing up the include for the console error handler, and adding a tes…
Browse files Browse the repository at this point in the history
…t for stderr handle.
  • Loading branch information
markstory committed Sep 4, 2010
1 parent fa7549d commit 42d998c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cake/tests/cases/console/console_error_handler.test.php
Expand Up @@ -17,7 +17,7 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Core', 'ConsoleErrorHandler');
require CAKE . 'console' . DS . 'console_error_handler.php';

class TestConsoleErrorHandler extends ConsoleErrorHandler {
public $output = array();
Expand Down Expand Up @@ -100,4 +100,16 @@ function testError500Exception() {
$this->assertEquals(1, count($result));
$this->assertEquals('dont use me in cli.', $result[0]);
}

/**
* test that ConsoleErrorHandler has a stderr file handle.
*
* @return void
*/
function testStdErrFilehandle() {
$exception = new Error500Exception('dont use me in cli.');
$error = new TestConsoleErrorHandler($exception);

$this->assertTrue(is_resource($error->stderr), 'No handle.');
}
}

0 comments on commit 42d998c

Please sign in to comment.