diff options
author | SVN Migration <svn@php.net> | 2005-06-10 18:06:44 +0000 |
---|---|---|
committer | SVN Migration <svn@php.net> | 2005-06-10 18:06:44 +0000 |
commit | 02889a1980340caaa4f2450c834da87fb675f848 (patch) | |
tree | 2e0b0f07f6810a635d5ecba89f63b6bfb63126f8 /pear/tests/PEAR_ErrorStack/TestUnit.php | |
parent | 3b1f8e9ad74ad07580e4248b39fd0db261c31aa0 (diff) | |
download | php-git-php-5.0.1b1.tar.gz |
This commit was manufactured by cvs2svn to create tag 'php_5_0_1b1'.php-5.0.1b1
Diffstat (limited to 'pear/tests/PEAR_ErrorStack/TestUnit.php')
-rw-r--r-- | pear/tests/PEAR_ErrorStack/TestUnit.php | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/pear/tests/PEAR_ErrorStack/TestUnit.php b/pear/tests/PEAR_ErrorStack/TestUnit.php deleted file mode 100644 index 1fe703f664..0000000000 --- a/pear/tests/PEAR_ErrorStack/TestUnit.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/** - * TestUnit runs a TestSuite and returns a TestResult object. - * And more than PHPUnit attach a listener to TestResult. - * - * @version $Id$ - * @author Laurent Laville <pear@laurent-laville.org> - * @package HTML_CSS - */ - -require_once 'PHPUnit.php'; - -class TestUnit extends PHPUnit { - - function &run(&$suite, $listener) { - $result = new TestResult(); - $result->addListener($listener); - $suite->run($result); - - return $result; - } -} - -class TestResult extends PHPUnit_TestResult { - - /* report result of test run */ - function report() { - echo "</TABLE>"; - - $nRun = $this->runCount(); - $nErrors = $this->errorCount(); - $nFailures = $this->failureCount(); - echo "<h2>Summary</h2>"; - - printf("<p>%s test%s run.<br>", $nRun, ($nRun > 1) ? 's' : ''); - printf("%s error%s.<br>\n", $nErrors, ($nErrors > 1) ? 's' : ''); - printf("%s failure%s.<br>\n", $nFailures, ($nFailures > 1) ? 's' : ''); - if ($nFailures > 0) { - echo "<h2>Failure Details</h2>"; - print("<ol>\n"); - $failures = $this->failures(); - while (list($i, $failure) = each($failures)) { - $failedTest = $failure->failedTest(); - printf("<li>%s\n", $failedTest->getName() ); - print("<ul>"); - printf("<li>%s\n", $failure->thrownException() ); - print("</ul>"); - } - print("</ol>\n"); - } - } - -} -?> |