Skip to content
This repository
Browse code

ENHANCEMENT If there are no test failures, but incomplete tests, mark

summary of test run as "ok but incomplete" in yellow for CliTestReporter
  • Loading branch information...
commit ce097a7b54ff0be93cb812c759bfc620fc0ee7c9 1 parent edaed5e
Sean Harvey authored April 15, 2012

Showing 1 changed file with 8 additions and 6 deletions. Show diff stats Hide diff stats

  1. 14  dev/CliTestReporter.php
14  dev/CliTestReporter.php
@@ -31,10 +31,12 @@ public function writeResults() {
31 31
 		}
32 32
 		
33 33
 		echo "\n\n";
34  
-		if ($failCount == 0) {
35  
-			echo SS_Cli::text(" ALL TESTS PASS ", "white", "green");
  34
+		if ($failCount == 0 && $incompleteCount > 0) {
  35
+			echo SS_Cli::text(" OK, BUT INCOMPLETE TESTS! ", "black", "yellow");
  36
+		} elseif ($failCount == 0) {
  37
+			echo SS_Cli::text(" ALL TESTS PASS ", "black", "green");
36 38
 		}  else {
37  
-			echo SS_Cli::text(" AT LEAST ONE FAILURE ", "white", "red");
  39
+			echo SS_Cli::text(" AT LEAST ONE FAILURE ", "black", "red");
38 40
 		}
39 41
 
40 42
 		echo sprintf("\n\n%d tests run: %s, %s, and %s\n", $testCount, SS_Cli::text("$passCount passes"), SS_Cli::text("$failCount failures"), SS_Cli::text("$incompleteCount incomplete"));
@@ -97,12 +99,12 @@ protected function writeTest($test) {
97 99
 			}
98 100
 
99 101
 			if( $test['status'] == 2) {
100  
-				echo "\n" . SS_Cli::text($this->testNameToPhrase($test['name']) . "\n" . $test['message'] . "\n", 'yellow', null, true);
  102
+				echo "\n" . SS_Cli::text($test['name'] . "\n" . $test['message'] . "\n", 'yellow', null);
101 103
 			} else {
102  
-				echo "\n" . SS_Cli::text($this->testNameToPhrase($test['name']) . "\n". $test['message'] . "\n", 'red', null, true);
  104
+				echo "\n" . SS_Cli::text($test['name'] . "\n". $test['message'] . "\n", 'red', null);
103 105
 				echo SS_Backtrace::get_rendered_backtrace($filteredTrace, true);
104 106
 			}
105  
-			echo "\n--------------------\n";
  107
+			echo "--------------------\n";
106 108
 		}
107 109
 	}
108 110
 	

0 notes on commit ce097a7

Please sign in to comment.
Something went wrong with that request. Please try again.