@@ -39,7 +39,6 @@ protected function writeProgressWithColor(string $progress, string $buffer): voi
3939 protected function printFooter (TestResult $ result ): void
4040 {
4141 parent ::printFooter ($ result );
42-
4342 if ($ this ->anyBarEnabled ) {
4443 $ phanyBar = new Phanybar ();
4544 if (sizeof ($ result ->failures ())) {
@@ -69,7 +68,6 @@ protected function formatExceptionMsg($exceptionMessage): string
6968 $ exceptionMessage = $ this ->setMessageColor ('risky ' , 'This test did not perform any assertions. ' );
7069 } else {
7170 $ marker = $ this ->markers ['fail ' ];
72-
7371 if ($ this ->colors ) {
7472 $ exceptionMessage = preg_replace ('/^(Exception.*)$/m ' , "\033[01;31m$1 \033[0m " , $ exceptionMessage );
7573 $ exceptionMessage = preg_replace ('/(Failed.*)$/m ' , "\033[01;31m %1 \$s$1 \033[0m " , $ exceptionMessage );
@@ -82,7 +80,7 @@ protected function formatExceptionMsg($exceptionMessage): string
8280
8381 $ exceptionMessage = ' ' . $ exceptionMessage ;
8482
85- return $ exceptionMessage ;
83+ return " $ exceptionMessage" ;
8684 }
8785
8886 protected function printDefectTrace (TestFailure $ defect ):void
@@ -169,13 +167,14 @@ protected function setMessageColor(string $type, $msg): string
169167 $ marker = 'skipped ' ;
170168 }
171169
172- // if user turned off colors, reset to white
170+ // if user turned off colors, return msg as we are down
173171 if (!$ this ->colors ) {
174- $ color = ' 37 ' ;
172+ return $ msg ;
175173 }
176- $ testMarker = $ this ->markers [$ marker ] ?? '' ;
177174
178- return "\033[01; {$ color }m {$ testMarker }{$ msg }\033[0m " ;
175+ // otherwise, we have colors enabled and time to make it pretty
176+ $ testMarker = $ this ->markers [$ marker ] ?? '' ;
177+ return "\033[01; {$ color }m {$ testMarker }{$ msg }\033[0m " ;
179178 }
180179 }
181180}
0 commit comments