X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fclasses%2Fthird_party%2Fphp_mailer%2Ftest%2Fphpunit.php;h=e0af5e69e9b28593152e5699ff2855af211b7dad;hb=42add96d2d56d2e672c8bae56887fc962697768c;hp=1d508680cc4d9fb753296d687c20a4a8cec3468b;hpb=c6d73b0e3246efc824cb98338d4be7ee5bc9f308;p=core.git diff --git a/inc/classes/third_party/php_mailer/test/phpunit.php b/inc/classes/third_party/php_mailer/test/phpunit.php index 1d508680..e0af5e69 100644 --- a/inc/classes/third_party/php_mailer/test/phpunit.php +++ b/inc/classes/third_party/php_mailer/test/phpunit.php @@ -5,7 +5,7 @@ // Written by Fred Yankowski // OntoSys, Inc // -// $Id: phpunit.php,v 1.1 2002/03/30 19:32:17 bmatzelle Exp $ +// $Id$ // Copyright (c) 2000 Fred Yankowski @@ -30,7 +30,7 @@ // SOFTWARE. // error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE | - E_CORE_ERROR | E_CORE_WARNING); + E_CORE_ERROR | E_CORE_WARNING); /* interface Test { @@ -46,11 +46,13 @@ function trace($msg) { } -class Exception { +class phpUnitException { /* Emulate a Java exception, sort of... */ var $message; - function Exception($message) { + var $type; + function phpUnitException($message, $type = 'FAILURE') { $this->message = $message; + $this->type = $type; } function getMessage() { return $this->message; @@ -82,7 +84,7 @@ class Assert { $htmlExpected = htmlspecialchars($expected); $htmlActual = htmlspecialchars($actual); $str .= sprintf("
%s\n--------\n%s
", - $htmlExpected, $htmlActual); + $htmlExpected, $htmlActual); $this->fail($str); } } @@ -194,24 +196,24 @@ class TestSuite /* implements Test */ { // get matched below and then treated (incorrectly) as a test // method. So don't name any TestCase subclasses as "Test..."! if (floor(phpversion()) >= 4) { - // PHP4 introspection, submitted by Dylan Kuhn - $names = get_class_methods($classname); - while (list($key, $method) = each($names)) { - if (preg_match('/^test/', $method) && $method != "testcase") { - $this->addTest(new $classname($method)); - } - } + // PHP4 introspection, submitted by Dylan Kuhn + $names = get_class_methods($classname); + while (list($key, $method) = each($names)) { + if (preg_match('/^test/', $method) && $method != "testcase") { + $this->addTest(new $classname($method)); + } + } } else { - $dummy = new $classname("dummy"); - $names = (array) $dummy; - while (list($key, $value) = each($names)) { - $type = gettype($value); - if ($type == "user function" && preg_match('/^test/', $key) - && $key != "testcase") { - $this->addTest(new $classname($key)); - } - } + $dummy = new $classname("dummy"); + $names = (array) $dummy; + while (list($key, $value) = each($names)) { + $type = gettype($value); + if ($type == "user function" && preg_match('/^test/', $key) + && $key != "testcase") { + $this->addTest(new $classname($key)); + } + } } } } @@ -227,7 +229,7 @@ class TestSuite /* implements Test */ { reset($this->fTests); while (list($na, $test) = each($this->fTests)) { if ($testResult->shouldStop()) - break; + break; $test->run(&$testResult); } } @@ -275,7 +277,7 @@ class TestResult { function _endTest($test) /* protected */ { /* specialize this for end-of-test action, such as progress - reports */ + reports */ } function getFailures() { @@ -324,7 +326,7 @@ class TextTestResult extends TestResult { function TextTestResult() { $this->TestResult(); // call superclass constructor } - + function report() { /* report result of test run */ $nRun = $this->countTests(); @@ -343,7 +345,7 @@ class TextTestResult extends TestResult { $exceptions = $failure->getExceptions(); print(""); } print("\n");