Пример #1
0
 /**
  * test default value of stream 'outputAs'
  */
 public function testDefaultOutputAs()
 {
     if (DS === '\\' && !(bool) env('ANSICON') && env('ConEmuANSI') !== 'ON' || function_exists('posix_isatty') && !posix_isatty(null)) {
         $expected = ConsoleOutput::PLAIN;
     } else {
         $expected = ConsoleOutput::COLOR;
     }
     $output = $this->getMockBuilder('Cake\\Console\\ConsoleOutput')->getMock();
     $output->expects($this->at(0))->method('outputAs')->with($expected);
     $log = new ConsoleLog(['stream' => $output]);
     $config = $log->config();
     $this->assertEquals($expected, $config['outputAs']);
 }
Пример #2
0
 /**
  * test default value of stream 'outputAs'
  */
 public function testDefaultOutputAs()
 {
     if (DS === '\\' && !(bool) env('ANSICON')) {
         $expected = ConsoleOutput::PLAIN;
     } else {
         $expected = ConsoleOutput::COLOR;
     }
     $output = $this->getMock('Cake\\Console\\ConsoleOutput');
     $output->expects($this->at(0))->method('outputAs')->with($expected);
     $log = new ConsoleLog(['stream' => $output]);
     $config = $log->config();
     $this->assertEquals($expected, $config['outputAs']);
 }