Skip to content
This repository
Browse code

Fix #129.

  • Loading branch information...
commit 1085e4a4e66106f229119bac92017fbe9fe18498 1 parent ac365cb
Sebastian Bergmann authored May 11, 2007

Showing 1 changed file with 33 additions and 0 deletions. Show diff stats Hide diff stats

  1. 33  PHPUnit/TestResult.php
33  PHPUnit/TestResult.php
@@ -329,6 +329,39 @@ function toString($showPasses = true) {
329 329
     }
330 330
 
331 331
     /**
  332
+     * Returns a summary of all test executions
  333
+     * 
  334
+     * @param boolean $html return HTML output rather than just text
  335
+     * @return string
  336
+     * @access public
  337
+     */
  338
+    function reportTestSummary($html = false) {
  339
+        $result = "\n";
  340
+        $result .= "TESTS   :  " . $this->runCount() . " test(s) executed.\n";
  341
+        $result .= "ERRORS  :  " . $this->errorCount() . " error(s) occurred.\n";
  342
+        $result .= "FAILURES:  " . $this->failureCount() . " failures occurred.\n";
  343
+        $result .= "\n";
  344
+        if ($html) return "<pre>" . htmlspecialchars($result) . "</pre>";
  345
+        else return $result;
  346
+    }
  347
+
  348
+    /**
  349
+     * Returns a listing of all test failures
  350
+     * 
  351
+     * @param boolean $html return HTML output rather than just text
  352
+     * @return string
  353
+     * @access public
  354
+     */
  355
+    function reportFailureListing($html = false) {
  356
+        $result = "\n";
  357
+        if ($this->failureCount() > 0) {
  358
+            $result .= "FAILURE LISTING:\n" . $this->toString(false);
  359
+        }
  360
+        if ($html) return "<pre>" . htmlspecialchars($result) . "</pre>";
  361
+        else return $result;        
  362
+    }
  363
+
  364
+    /**     
332 365
      * Returns whether the entire test was successful or not.
333 366
      *
334 367
      * @return boolean

0 notes on commit 1085e4a

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