fix: windows console may not have ansi color support

This commit is contained in:
Rachman Chavik 2012-07-02 21:19:02 +07:00
parent 31033239bd
commit 86a74e3887
2 changed files with 23 additions and 1 deletions

View file

@ -116,4 +116,21 @@ class ConsoleLogTest extends CakeTestCase {
$this->assertContains($message, $logOutput);
}
/**
* test default value of stream 'outputAs'
*/
public function testDefaultOutputAs() {
TestCakeLog::config('test_console_log', array(
'engine' => 'TestConsoleLog',
));
if (DS == '\\' && !(bool)env('ANSICON')) {
$expected = ConsoleOutput::PLAIN;
} else {
$expected = ConsoleOutput::COLOR;
}
$stream = TestCakeLog::stream('test_console_log');
$config = $stream->config();
$this->assertEquals($expected, $config['outputAs']);
}
}