Source for file TestSuite.php
Documentation is available at TestSuite.php
// +------------------------------------------------------------------------+
// +------------------------------------------------------------------------+
// | Copyright (c) 2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>. |
// +------------------------------------------------------------------------+
// | This source file is subject to version 3.00 of the PHP License, |
// | that is available at http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +------------------------------------------------------------------------+
// $Id: TestSuite.php,v 1.13 2004/12/22 08:06:11 sebastian Exp $
require_once 'PHPUnit/TestCase.php';
* A TestSuite is a Composite of Tests. It runs a collection of test cases.
* Here is an example using the dynamic test definition.
* $suite = new PHPUnit_TestSuite();
* $suite->addTest(new MathTest('testPass'));
* Alternatively, a TestSuite can extract the tests to be run automatically.
* To do so you pass the classname of your TestCase class to the TestSuite
* $suite = new TestSuite('classname');
* This constructor creates a suite with all the methods starting with
* "test" that take no arguments.
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
* @copyright Copyright © 2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>
* @license http://www.php.net/license/3_0.txt The PHP License, Version 3.0
* The name of the test suite.
* The tests in the test suite.
* Constructs a TestSuite.
* Adds a test to the suite.
* Adds the tests from the given class to the suite.
$parentClass = $testClass;
$parentClasses[] = $parentClass;
foreach ($methods as $method) {
if (substr($method, 0 , 4 ) == 'test' &&
$this->addTest(new $testClass($method));
* Counts the number of test cases that will be run by this test.
foreach ($this->_tests as $test) {
$count += $test->countTestCases ();
* Returns the name of the suite.
* Runs the tests and collects their result in a TestResult.
for ($i = 0; $i < sizeof($this->_tests) && !$result->shouldStop (); $i++ ) {
$this->_tests[$i]->run ($result);
function runTest(&$test, &$result) {
* Sets the name of the suite.
* Returns the test at the given index.
if (isset ($this->_tests[$index])) {
return $this->_tests[$index];
* Returns the number of tests in this suite.
* Returns the tests as an enumeration.
* Returns a string representation of the test suite.
Documentation generated on Mon, 11 Mar 2019 14:22:36 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|