/** * Write an optionally colored message * * @param string $message * @param string $pallet * @return DbPatch_Core_Writer */ public function _message($message, $pallet = '') { if ($this->_color !== null && $pallet != '') { $message = $this->_color->pallet($pallet) . $message . $this->_color->reset(); } $message .= PHP_EOL; $stream = null; if ($pallet != 'info') { $stream = STDERR; } return $this->output($message, $stream); }
public function testInValidPallet() { $color = new DbPatch_Core_Color(); $ret = $color->pallet('error_warning'); $this->assertEquals($ret, "[K[0m"); }