public static function text($text, $foreground = null, $background = null, $bold = false, $underline = false) { $colored = "["; if ($bold) { $colored .= '1;'; } if ($underline) { $colored .= '4;'; } if ($foreground !== null && isset(self::$colors[$foreground])) { $colored .= self::$colors[$foreground] . ";"; } if ($background !== null && isset(self::$background[$background])) { $colored .= self::$background[$background] . ";"; } $colored = rtrim($colored, ';'); $colored .= "m" . $text . "[0m"; return $colored; }
/** * @param \PHPUnit_Framework_TestSuite $suite * @return void */ public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) { $time = sprintf('%0.3f sec', microtime(1) - $this->timeSuite); echo "\n"; echo Colorize::text("Suite Time: " . $time, 'white', null, true); echo "\n"; }