예제 #1
0
 public function getResultPrinter()
 {
     $terminal = new Terminal();
     if ($this->ci || $terminal->getColors() < 2) {
         return new CIResultPrinter();
     }
     return new DefaultResultPrinter();
 }
예제 #2
0
 public function testGetColorsIs1ForUnknownTerminal()
 {
     $term = getenv('TERM');
     putenv('TERM=');
     $terminal = new Terminal();
     $this->assert($terminal->getColors())->equals(1);
     putenv("TERM={$term}");
 }
예제 #3
0
 public function __construct(DefaultTheme $theme = null)
 {
     $terminal = new Terminal();
     $this->width = $terminal->getColumns();
     if (!$theme) {
         $theme = new DefaultTheme();
     }
     $this->theme = $theme;
     $this->counter = new ProgressCounter(0, true);
     $this->startTime = time();
     $this->formatter = new TimeFormatter();
 }