cvs: pear(ZEND_ENGINE_2) /PHPUnit PHPUnit.php /PHPUnit/PHPUnit Assert.php RepeatedTest.php TestCase.php TestDecorator.php TestFailure.php
TestListener.php TestResult.php TestSuite.php

From: Date: Sat, 28 Sep 2002 15:39:35 +0000
Subject: cvs: pear(ZEND_ENGINE_2) /PHPUnit PHPUnit.php /PHPUnit/PHPUnit Assert.php RepeatedTest.php TestCase.php TestDecorator.php TestFailure.php
TestListener.php TestResult.php TestSuite.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-6725@lists.php.net to get a copy of this message
sebastian Sat Sep 28 11:39:35 2002 EDT Modified files: (Branch: ZEND_ENGINE_2) /pear/PHPUnit PHPUnit.php /pear/PHPUnit/PHPUnit Assert.php RepeatedTest.php TestCase.php TestDecorator.php TestFailure.php TestListener.php TestResult.php TestSuite.php Log: Add missing vim folding marks.

Index: pear/PHPUnit/PHPUnit.php diff -u pear/PHPUnit/PHPUnit.php:1.6.2.2 pear/PHPUnit/PHPUnit.php:1.6.2.3 --- pear/PHPUnit/PHPUnit.php:1.6.2.2 Wed Sep 25 03:34:11 2002 +++ pear/PHPUnit/PHPUnit.php Sat Sep 28 11:39:35 2002 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // -// $Id: PHPUnit.php,v 1.6.2.2 2002/09/25 07:34:11 sebastian Exp $ +// $Id: PHPUnit.php,v 1.6.2.3 2002/09/28 15:39:35 sebastian Exp $ // require_once 'PHPUnit/TestCase.php'; @@ -65,11 +65,20 @@ * Based upon JUnit, see http://www.junit.org/ for details. */ class PHPUnit { + // {{{ function run($suite) + function run($suite) { $result = new PHPUnit::TestResult(); $suite->run($result); return $result; } + + // }}} } + +/* + * vim600: et sw=2 ts=2 fdm=marker + * vim<600: et sw=2 ts=2 + */ ?> Index: pear/PHPUnit/PHPUnit/Assert.php diff -u pear/PHPUnit/PHPUnit/Assert.php:1.1.2.3 pear/PHPUnit/PHPUnit/Assert.php:1.1.2.4 --- pear/PHPUnit/PHPUnit/Assert.php:1.1.2.3 Wed Sep 25 03:34:14 2002 +++ pear/PHPUnit/PHPUnit/Assert.php Sat Sep 28 11:39:35 2002 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // -// $Id: Assert.php,v 1.1.2.3 2002/09/25 07:34:14 sebastian Exp $ +// $Id: Assert.php,v 1.1.2.4 2002/09/28 15:39:35 sebastian Exp $ // /** @@ -23,6 +23,8 @@ * Based upon JUnit, see http://www.junit.org/ for details. */ class PHPUnit::Assert { + // {{{ function assertEquals($expected, $actual, $message = '', $delta = 0) + /** * Asserts that two variables are equal. * @@ -93,6 +95,9 @@ return $this->pass(); } + // }}} + // {{{ function assertNotNull($object, $message = '') + /** * Asserts that an object isn't null. * @@ -112,6 +117,9 @@ return $this->pass(); } + // }}} + // {{{ function assertNull($object, $message = '') + /** * Asserts that an object is null. * @@ -131,6 +139,9 @@ return $this->pass(); } + // }}} + // {{{ function assertSame($expected, $actual, $message = '') + /** * Asserts that two objects refer to the same object. * @@ -151,6 +162,9 @@ return $this->pass(); } + // }}} + // {{{ function assertNotSame($expected, $actual, $message = '') + /** * Asserts that two objects refer not to the same object. * @@ -171,6 +185,9 @@ return $this->pass(); } + // }}} + // {{{ function assertTrue($condition, $message = '') + /** * Asserts that a condition is true. * @@ -190,6 +207,9 @@ return $this->pass(); } + // }}} + // {{{ function assertFalse($condition, $message = '') + /** * Asserts that a condition is false. * @@ -209,6 +229,9 @@ return $this->pass(); } + // }}} + // {{{ function assertRegExp($expected, $actual, $message = '') + /** * Asserts that a string matches a given * regular expression. @@ -235,6 +258,9 @@ return $this->pass(); } + // }}} + // {{{ function fail($message = '') + /** * Fails a test with the given message. * @@ -244,6 +270,9 @@ */ function fail($message = '') { /* abstract */ } + // }}} + // {{{ function pass() + /** * Passes a test. * @@ -251,5 +280,12 @@ * @abstract */ function pass() { /* abstract */ } + + // }}} } + +/* + * vim600: et sw=2 ts=2 fdm=marker + * vim<600: et sw=2 ts=2 + */ ?> Index: pear/PHPUnit/PHPUnit/RepeatedTest.php diff -u pear/PHPUnit/PHPUnit/RepeatedTest.php:1.1.2.4 pear/PHPUnit/PHPUnit/RepeatedTest.php:1.1.2.5 --- pear/PHPUnit/PHPUnit/RepeatedTest.php:1.1.2.4 Wed Sep 25 03:34:14 2002 +++ pear/PHPUnit/PHPUnit/RepeatedTest.php Sat Sep 28 11:39:35 2002 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // -// $Id: RepeatedTest.php,v 1.1.2.4 2002/09/25 07:34:14 sebastian Exp $ +// $Id: RepeatedTest.php,v 1.1.2.5 2002/09/28 15:39:35 sebastian Exp $ // require_once 'PHPUnit/TestDecorator.php'; @@ -61,12 +61,17 @@ * Based upon JUnit, see http://www.junit.org/ for details. */ class PHPUnit::RepeatedTest extends PHPUnit::TestDecorator { + // {{{ Members + /** * @var integer * @access private */ private $timesRepeat = 1; + // }}} + // {{{ function __construct($test, $timesRepeat = 1) + /** * Constructor. * @@ -79,6 +84,9 @@ $this->timesRepeat = $timesRepeat; } + // }}} + // {{{ function countTestCases() + /** * Counts the number of test cases that * will be run by this test. @@ -90,6 +98,9 @@ return $this->timesRepeat * $this->test->countTestCases(); } + // }}} + // {{{ function run($result) + /** * Runs the decorated test and collects the * result in a TestResult. @@ -103,5 +114,12 @@ $this->test->run($result); } } + + // }}} } + +/* + * vim600: et sw=2 ts=2 fdm=marker + * vim<600: et sw=2 ts=2 + */ ?> Index: pear/PHPUnit/PHPUnit/TestCase.php diff -u pear/PHPUnit/PHPUnit/TestCase.php:1.2.2.4 pear/PHPUnit/PHPUnit/TestCase.php:1.2.2.5 --- pear/PHPUnit/PHPUnit/TestCase.php:1.2.2.4 Wed Sep 25 03:34:14 2002 +++ pear/PHPUnit/PHPUnit/TestCase.php Sat Sep 28 11:39:35 2002 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // -// $Id: TestCase.php,v 1.2.2.4 2002/09/25 07:34:14 sebastian Exp $ +// $Id: TestCase.php,v 1.2.2.5 2002/09/28 15:39:35 sebastian Exp $ // require_once 'PHPUnit/Assert.php'; @@ -60,6 +60,8 @@ * Based upon JUnit, see http://www.junit.org/ for details. */ class PHPUnit::TestCase extends PHPUnit::Assert { + // {{{ Members + /** * The name of the test case. * @@ -76,6 +78,9 @@ */ private $result; + // }}} + // {{{ function __construct($name = false) + /** * Constructs a test case with the given name. * @@ -88,6 +93,9 @@ } } + // }}} + // {{{ function countTestCases() + /** * Counts the number of test cases executed by run(TestResult result). * @@ -98,6 +106,9 @@ return 1; } + // }}} + // {{{ function getName() + /** * Gets the name of a TestCase. * @@ -108,6 +119,9 @@ return $this->name; } + // }}} + // {{{ function run($result) + /** * Runs the test case and collects the results in a given TestResult object. * @@ -122,6 +136,9 @@ return $this->result; } + // }}} + // {{{ function runBare() + /** * Runs the bare test sequence. * @@ -133,6 +150,9 @@ $this->tearDown(); } + // }}} + // {{{ function runTest() + /** * Override to run the test and assert its state. * @@ -143,6 +163,9 @@ $this->$name(); } + // }}} + // {{{ function setName($name) + /** * Sets the name of a TestCase. * @@ -153,6 +176,9 @@ $this->name = $name; } + // }}} + // {{{ function toString() + /** * Returns a string representation of the test case. * @@ -163,6 +189,9 @@ return ''; } + // }}} + // {{{ function createResult() + /** * Creates a default TestResult object. * @@ -173,6 +202,9 @@ return new PHPUnit::TestResult; } + // }}} + // {{{ function fail($message = '') + /** * Fails a test with the given message. * @@ -183,6 +215,9 @@ $this->result->addFailure($this, $message); } + // }}} + // {{{ function pass() + /** * Passes a test. * @@ -192,6 +227,8 @@ $this->result->addPassedTest($this); } + // }}} + // {{{ function setUp() /** * Sets up the fixture, for example, open a network connection. @@ -202,6 +239,9 @@ */ function setUp() { /* abstract */ } + // }}} + // {{{ function tearDown() + /** * Tears down the fixture, for example, close a network connection. * This method is called after a test is executed. @@ -210,5 +250,12 @@ * @abstract */ function tearDown() { /* abstract */ } + + // }}} } + +/* + * vim600: et sw=2 ts=2 fdm=marker + * vim<600: et sw=2 ts=2 + */ ?> Index: pear/PHPUnit/PHPUnit/TestDecorator.php diff -u pear/PHPUnit/PHPUnit/TestDecorator.php:1.1.2.4 pear/PHPUnit/PHPUnit/TestDecorator.php:1.1.2.5 --- pear/PHPUnit/PHPUnit/TestDecorator.php:1.1.2.4 Wed Sep 25 03:34:14 2002 +++ pear/PHPUnit/PHPUnit/TestDecorator.php Sat Sep 28 11:39:35 2002 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // -// $Id: TestDecorator.php,v 1.1.2.4 2002/09/25 07:34:14 sebastian Exp $ +// $Id: TestDecorator.php,v 1.1.2.5 2002/09/28 15:39:35 sebastian Exp $ // require_once 'PHPUnit/TestCase.php'; @@ -30,6 +30,8 @@ * Based upon JUnit, see http://www.junit.org/ for details. */ class PHPUnit::TestDecorator { + // {{{ Members + /** * The Test to be decorated. * @@ -38,6 +40,9 @@ */ private $test = null; + // }}} + // {{{ function __construct($test) + /** * Constructor. * @@ -53,6 +58,9 @@ } } + // }}} + // {{{ function basicRun($result) + /** * Runs the test and collects the * result in a TestResult. @@ -64,6 +72,9 @@ $this->test->run($result); } + // }}} + // {{{ function countTestCases() + /** * Counts the number of test cases that * will be run by this test. @@ -75,6 +86,9 @@ return $this->test->countTestCases(); } + // }}} + // {{{ function getTest() + /** * Returns the test to be run. * @@ -85,6 +99,9 @@ return $this->test; } + // }}} + // {{{ function run($result) + /** * Runs the decorated test and collects the * result in a TestResult. @@ -95,6 +112,9 @@ */ function run($result) { /* abstract */ } + // }}} + // {{{ function toString() + /** * Returns a string representation of the test. * @@ -104,5 +124,12 @@ function toString() { return $this->test->toString(); } + + // }}} } + +/* + * vim600: et sw=2 ts=2 fdm=marker + * vim<600: et sw=2 ts=2 + */ ?> Index: pear/PHPUnit/PHPUnit/TestFailure.php diff -u pear/PHPUnit/PHPUnit/TestFailure.php:1.1.2.3 pear/PHPUnit/PHPUnit/TestFailure.php:1.1.2.4 --- pear/PHPUnit/PHPUnit/TestFailure.php:1.1.2.3 Wed Sep 25 03:34:14 2002 +++ pear/PHPUnit/PHPUnit/TestFailure.php Sat Sep 28 11:39:35 2002 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // -// $Id: TestFailure.php,v 1.1.2.3 2002/09/25 07:34:14 sebastian Exp $ +// $Id: TestFailure.php,v 1.1.2.4 2002/09/28 15:39:35 sebastian Exp $ // /** @@ -23,6 +23,8 @@ * Based upon JUnit, see http://www.junit.org/ for details. */ class PHPUnit::TestFailure { + // {{{ Members + /** * @var object * @access private @@ -35,6 +37,9 @@ */ private $thrownException; + // }}} + // {{{ function __construct($failedTest, $thrownException) + /** * Constructs a TestFailure with the given test and exception. * @@ -47,6 +52,9 @@ $this->thrownException = $thrownException; } + // }}} + // {{{ function failedTest() + /** * Gets the failed test. * @@ -57,6 +65,9 @@ return $this->failedTest; } + // }}} + // {{{ function thrownException() + /** * Gets the thrown exception. * @@ -67,6 +78,9 @@ return $this->thrownException; } + // }}} + // {{{ function toString() + /** * Returns a short description of the failure. * @@ -82,5 +96,12 @@ $this->thrownException ); } + + // }}} } + +/* + * vim600: et sw=2 ts=2 fdm=marker + * vim<600: et sw=2 ts=2 + */ ?> Index: pear/PHPUnit/PHPUnit/TestListener.php diff -u pear/PHPUnit/PHPUnit/TestListener.php:1.1.2.4 pear/PHPUnit/PHPUnit/TestListener.php:1.1.2.5 --- pear/PHPUnit/PHPUnit/TestListener.php:1.1.2.4 Wed Sep 25 03:34:14 2002 +++ pear/PHPUnit/PHPUnit/TestListener.php Sat Sep 28 11:39:35 2002 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // -// $Id: TestListener.php,v 1.1.2.4 2002/09/25 07:34:14 sebastian Exp $ +// $Id: TestListener.php,v 1.1.2.5 2002/09/28 15:39:35 sebastian Exp $ // /** @@ -75,6 +75,8 @@ * Based upon JUnit, see http://www.junit.org/ for details. */ class PHPUnit::TestListener { + // {{{ function addError($test, $t) + /** * An error occurred. * @@ -85,6 +87,9 @@ */ function addError($test, $t) { /*abstract */ } + // }}} + // {{{ function addFailure($test, $t) + /** * A failure occurred. * @@ -95,6 +100,9 @@ */ function addFailure($test, $t) { /*abstract */ } + // }}} + // {{{ function endTest($test) + /** * A test ended. * @@ -104,6 +112,9 @@ */ function endTest($test) { /*abstract */ } + // }}} + // {{{ function startTest($test) + /** * A test started. * @@ -112,5 +123,12 @@ * @abstract */ function startTest($test) { /*abstract */ } + + // }}} } + +/* + * vim600: et sw=2 ts=2 fdm=marker + * vim<600: et sw=2 ts=2 + */ ?> Index: pear/PHPUnit/PHPUnit/TestResult.php diff -u pear/PHPUnit/PHPUnit/TestResult.php:1.1.2.3 pear/PHPUnit/PHPUnit/TestResult.php:1.1.2.4 --- pear/PHPUnit/PHPUnit/TestResult.php:1.1.2.3 Wed Sep 25 03:34:14 2002 +++ pear/PHPUnit/PHPUnit/TestResult.php Sat Sep 28 11:39:35 2002 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // -// $Id: TestResult.php,v 1.1.2.3 2002/09/25 07:34:14 sebastian Exp $ +// $Id: TestResult.php,v 1.1.2.4 2002/09/28 15:39:35 sebastian Exp $ // require_once 'PHPUnit/TestFailure.php'; @@ -26,6 +26,8 @@ * Based upon JUnit, see http://www.junit.org/ for details. */ class PHPUnit::TestResult { + // {{{ Members + /** * @var array * @access protected @@ -62,6 +64,9 @@ */ private $stop = false; + // }}} + // {{{ function addError($test, $t) + /** * Adds an error to the list of errors. * The passed in exception caused the error. @@ -78,6 +83,9 @@ } } + // }}} + // {{{ function addFailure($test, $t) + /** * Adds a failure to the list of failures. * The passed in exception caused the failure. @@ -94,6 +102,9 @@ } } + // }}} + // {{{ function addListener($listener) + /** * Registers a TestListener. * @@ -107,6 +118,9 @@ } } + // }}} + // {{{ function addPassedTest($test) + /** * Adds a passed test to the list of passed tests. * @@ -117,6 +131,9 @@ $this->passedTests[] = $test; } + // }}} + // {{{ function endTest($test) + /** * Informs the result that a test was completed. * @@ -129,6 +146,9 @@ } } + // }}} + // {{{ function errorCount() + /** * Gets the number of detected errors. * @@ -139,6 +159,9 @@ return sizeof($this->errors); } + // }}} + // {{{ function errors() + /** * Returns an Enumeration for the errors. * @@ -149,6 +172,9 @@ return $this->errors; } + // }}} + // {{{ function failureCount() + /** * Gets the number of detected failures. * @@ -159,6 +185,9 @@ return sizeof($this->failures); } + // }}} + // {{{ function failures() + /** * Returns an Enumeration for the failures. * @@ -169,6 +198,9 @@ return $this->failures; } + // }}} + // {{{ function removeListener($listener) + /** * Unregisters a TestListener. * This requires the Zend Engine 2 (to work properly). @@ -184,6 +216,9 @@ } } + // }}} + // {{{ function run($test) + /** * Runs a TestCase. * @@ -197,6 +232,9 @@ $this->endTest($test); } + // }}} + // {{{ function runCount() + /** * Gets the number of run tests. * @@ -207,6 +245,9 @@ return $this->runTests; } + // }}} + // {{{ function shouldStop() + /** * Checks whether the test run should stop. * @@ -216,6 +257,9 @@ return $this->stop; } + // }}} + // {{{ function startTest($test) + /** * Informs the result that a test will be started. * @@ -228,6 +272,9 @@ } } + // }}} + // {{{ function stop() + /** * Marks that the test run should stop. * @@ -237,6 +284,9 @@ $this->stop = true; } + // }}} + // {{{ function toHTML() + /** * Returns a HTML representation of the test result. * @@ -247,6 +297,9 @@ return '<pre>' . htmlspecialchars($this->toString()) . '</pre>'; } + // }}} + // {{{ function toString() + /** * Returns a text representation of the test result. * @@ -271,6 +324,10 @@ return $result; } + + // }}} + // {{{ function wasSuccessful() + /** * Returns whether the entire test was successful or not. * @@ -284,5 +341,12 @@ return false; } } + + // }}} } + +/* + * vim600: et sw=2 ts=2 fdm=marker + * vim<600: et sw=2 ts=2 + */ ?> Index: pear/PHPUnit/PHPUnit/TestSuite.php diff -u pear/PHPUnit/PHPUnit/TestSuite.php:1.1.2.3 pear/PHPUnit/PHPUnit/TestSuite.php:1.1.2.4 --- pear/PHPUnit/PHPUnit/TestSuite.php:1.1.2.3 Wed Sep 25 03:34:14 2002 +++ pear/PHPUnit/PHPUnit/TestSuite.php Sat Sep 28 11:39:35 2002 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // -// $Id: TestSuite.php,v 1.1.2.3 2002/09/25 07:34:14 sebastian Exp $ +// $Id: TestSuite.php,v 1.1.2.4 2002/09/28 15:39:35 sebastian Exp $ // require_once 'PHPUnit/TestCase.php'; @@ -39,6 +39,8 @@ * Based upon JUnit, see http://www.junit.org/ for details. */ class PHPUnit::TestSuite { + // {{{ Members + /** * The name of the test suite. * @@ -55,6 +57,9 @@ */ private $tests = array(); + // }}} + // {{{ function __construct($test = false) + /** * Constructs a TestSuite. * @@ -68,6 +73,9 @@ } } + // }}} + // {{{ function addTest($test) + /** * Adds a test to the suite. * @@ -78,6 +86,9 @@ $this->tests[] = $test; } + // }}} + // {{{ function addTestSuite($testClass) + /** * Adds the tests from the given class to the suite. * @@ -96,6 +107,9 @@ } } + // }}} + // {{{ function countTestCases() + /** * Counts the number of test cases that will be run by this test. * @@ -112,6 +126,9 @@ return $count; } + // }}} + // {{{ function getName() + /** * Returns the name of the suite. * @@ -122,6 +139,9 @@ return $this->name; } + // }}} + // {{{ function run($result) + /** * Runs the tests and collects their result in a TestResult. * @@ -134,6 +154,9 @@ } } + // }}} + // {{{ function runTest($test, $result) + /** * Runs a test. * @@ -145,6 +168,9 @@ $test->run($result); } + // }}} + // {{{ function setName($name) + /** * Sets the name of the suite. * @@ -155,6 +181,9 @@ $this->name = $name; } + // }}} + // {{{ function testAt($index) + /** * Returns the test at the given index. * @@ -170,6 +199,9 @@ } } + // }}} + // {{{ function testCount() + /** * Returns the number of tests in this suite. * @@ -180,6 +212,9 @@ return sizeof($this->tests); } + // }}} + // {{{ function tests() + /** * Returns the tests as an enumeration. * @@ -190,6 +225,9 @@ return $this->tests; } + // }}} + // {{{ function toString() + /** * Returns a string representation of the test suite. * @@ -199,5 +237,12 @@ function toString() { return ''; } + + // }}} } + +/* + * vim600: et sw=2 ts=2 fdm=marker + * vim<600: et sw=2 ts=2 + */ ?>
« previous php.pear.cvs (#6725) next »