Skip to content

Commit

Permalink
Making error output style have an underline.
Browse files Browse the repository at this point in the history
Adding a comment style which has blue text.
  • Loading branch information
markstory committed Oct 14, 2010
1 parent f5ad54e commit a325974
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions cake/console/console_output.php
Expand Up @@ -24,9 +24,10 @@
* Can generate colourzied output on consoles that support it. There are a few
* built in styles
*
* - `error` Error messages. Bright red text.
* - `warning` Warning messages. Bright orange text
* - `info` Informational messages. Cyan text.
* - `error` Error messages.
* - `warning` Warning messages.
* - `info` Informational messages.
* - `comment` Additional text.
*
* By defining styles with addStyle() you can create custom console styles.
*
Expand Down Expand Up @@ -113,10 +114,11 @@ class ConsoleOutput {
* @var array
*/
protected static $_styles = array(
'error' => array('text' => 'red'),
'error' => array('text' => 'red', 'underline' => true),
'warning' => array('text' => 'yellow'),
'info' => array('text' => 'cyan'),
'success' => array('text' => 'green')
'success' => array('text' => 'green'),
'comment' => array('text' => 'blue')
);

/**
Expand Down
6 changes: 3 additions & 3 deletions cake/tests/cases/console/console_output.test.php
Expand Up @@ -96,7 +96,7 @@ function testWriteArray() {
*/
function testStylesGet() {
$result = $this->output->styles('error');
$expected = array('text' => 'red');
$expected = array('text' => 'red', 'underline' => true);
$this->assertEqual($result, $expected);

$this->assertNull($this->output->styles('made_up_goop'));
Expand Down Expand Up @@ -128,7 +128,7 @@ function testStylesAdding() {
*/
function testFormattingSimple() {
$this->output->expects($this->once())->method('_write')
->with("\033[31mError:\033[0m Something bad");
->with("\033[31;4mError:\033[0m Something bad");

$this->output->write('<error>Error:</error> Something bad', false);
}
Expand Down Expand Up @@ -171,7 +171,7 @@ function testFormattingMissingStyleName() {
*/
function testFormattingMultipleStylesName() {
$this->output->expects($this->once())->method('_write')
->with("\033[31mBad\033[0m \033[33mWarning\033[0m Regular");
->with("\033[31;4mBad\033[0m \033[33mWarning\033[0m Regular");

$this->output->write('<error>Bad</error> <warning>Warning</warning> Regular', false);
}
Expand Down

0 comments on commit a325974

Please sign in to comment.