Complete tests for CliController.

This commit is contained in:
Alexander Demidov
2012-07-11 17:23:14 +04:00
parent ac091ac1ed
commit ad9c6b0a0c
2 changed files with 57 additions and 7 deletions

View File

@ -19,9 +19,12 @@ class CliController
*/
protected static $instance;
protected $error_stream;
protected function __construct()
{
ErrorHandler::init();
$this->error_stream = fopen('php://stderr', 'rw');
}
/**
@ -51,9 +54,8 @@ class CliController
echo PHP_EOL . Profiler::getInstance()->getCli();
}
} catch (Exception $e) {
$stderr = fopen('php://stderr', 'w');
fputs($stderr, PHP_EOL . 'Error: ' . $e->getMessage() . PHP_EOL);
fputs($stderr, PHP_EOL . 'Stack trace: ' . PHP_EOL . $e->getTraceAsString() . PHP_EOL);
fwrite($this->error_stream, PHP_EOL . 'Error: ' . $e->getMessage() . PHP_EOL);
fwrite($this->error_stream, PHP_EOL . 'Stack trace: ' . PHP_EOL . $e->getTraceAsString() . PHP_EOL);
}
}
}