Skip to content
This repository
Browse code

Fix #128.

  • Loading branch information...
commit ac365cb4a24f9e4d377673e87f3c0195fb1cd750 1 parent e5a3edc
Sebastian Bergmann authored May 11, 2007

Showing 1 changed file with 16 additions and 10 deletions. Show diff stats Hide diff stats

  1. 26  PHPUnit/TestResult.php
26  PHPUnit/TestResult.php
@@ -290,29 +290,35 @@ function stop() {
290 290
     /**
291 291
      * Returns a HTML representation of the test result.
292 292
      *
  293
+     * @param boolean $showPasses whether or not to print passing test results
  294
+     *             (defaults to TRUE for backward compatibility)
293 295
      * @return string
294 296
      * @access public
295 297
      */
296  
-    function toHTML() {
297  
-        return '<pre>' . htmlspecialchars($this->toString()) . '</pre>';
  298
+    function toHTML($showPasses = true) {
  299
+        return '<pre>' . htmlspecialchars($this->toString($showPasses)) . '</pre>';
298 300
     }
299 301
 
300 302
     /**
301 303
      * Returns a text representation of the test result.
302 304
      *
  305
+     * @param boolean $showPasses whether or not to print passing test results
  306
+     *             (defaults to TRUE for backward compatibility)
303 307
      * @return string
304 308
      * @access public
305 309
      */
306  
-    function toString() {
  310
+    function toString($showPasses = true) {
307 311
         $result = '';
308 312
 
309  
-        foreach ($this->_passedTests as $passedTest) {
310  
-            $result .= sprintf(
311  
-              "TestCase %s->%s() passed\n",
312  
-
313  
-              get_class($passedTest),
314  
-              $passedTest->getName()
315  
-            );
  313
+        if ($showPasses) {
  314
+            foreach ($this->_passedTests as $passedTest) {
  315
+                $result .= sprintf(
  316
+                  "TestCase %s->%s() passed\n",
  317
+    
  318
+                  get_class($passedTest),
  319
+                  $passedTest->getName()
  320
+                );
  321
+            }
316 322
         }
317 323
 
318 324
         foreach ($this->_failures as $failedTest) {

0 notes on commit ac365cb

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