Changeset 106
- Timestamp:
- 01/09/08 00:08:16 (12 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Stagehand/TestRunner/PHPSpec/Reporter.php
r105 r106 107 107 switch ($symbol) { 108 108 case '.': 109 $symbol = Console_Color::convert("%g$symbol%n");109 $symbol = $this->_green($symbol); 110 110 break; 111 111 case 'F': 112 $symbol = Console_Color::convert("%r$symbol%n");112 $symbol = $this->_red($symbol); 113 113 break; 114 114 case 'E': 115 $symbol = Console_Color::convert("%p$symbol%n");115 $symbol = $this->_magenta($symbol); 116 116 break; 117 117 case 'P': 118 $symbol = Console_Color::convert("%y$symbol%n");118 $symbol = $this->_yellow($symbol); 119 119 break; 120 120 } … … 145 145 146 146 if ($failuresCount + $deliberateFailuresCount + $errorsCount + $exceptionsCount + $pendingsCount == 0) { 147 $colorCode = ' %g';147 $colorCode = 'green'; 148 148 } elseif ($pendingsCount && $failuresCount + $deliberateFailuresCount + $errorsCount + $exceptionsCount == 0) { 149 $colorCode = ' %y';149 $colorCode = 'yellow'; 150 150 } else { 151 $colorCode = ' %r';151 $colorCode = 'red'; 152 152 } 153 153 … … 165 165 '/^(Pending:)/m' 166 166 ), 167 array( "$colorCode\$1%n",168 '%p$1$2$3%n',169 '%r$1$2$3%n',170 '%r$1$2$3%n',171 '%y$1$2$3%n',172 '%g$1$2$3%n',173 '$1 %p$2%n',174 '$1 %r$2%n',175 '$1 %y$2%n',176 '%p$1%n',177 '%r$1%n',178 '%y$1%n'167 array($this->{"_$colorCode"}('$1'), 168 $this->_magenta('$1$2$3'), 169 $this->_red('$1$2$3'), 170 $this->_red('$1$2$3'), 171 $this->_yellow('$1$2$3'), 172 $this->_green('$1$2$3'), 173 '$1' . $this->_magenta('$2'), 174 '$1' . $this->_red('$2'), 175 '$1' . $this->_yellow('$2'), 176 $this->_magenta('$1'), 177 $this->_red('$1'), 178 $this->_yellow('$1') 179 179 ), 180 180 Console_Color::escape($output)) … … 196 196 * @access private 197 197 */ 198 199 // }}} 200 // {{{ _green() 201 202 /** 203 * @param string $text 204 * @return text 205 */ 206 private function _green($text) 207 { 208 return Console_Color::convert("%g$text%n"); 209 } 210 211 // }}} 212 // {{{ _red() 213 214 /** 215 * @param string $text 216 * @return text 217 */ 218 private function _red($text) 219 { 220 return Console_Color::convert("%r$text%n"); 221 } 222 223 // }}} 224 // {{{ _magenta() 225 226 /** 227 * @param string $text 228 * @return text 229 */ 230 private function _magenta($text) 231 { 232 return Console_Color::convert("%m$text%n"); 233 } 234 235 // }}} 236 // {{{ _yellow() 237 238 /** 239 * @param string $text 240 * @return text 241 */ 242 private function _yellow($text) 243 { 244 return Console_Color::convert("%y$text%n"); 245 } 198 246 199 247 /**#@-*/
