Complete tests for CliController.
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user