PHPUnit_Framework_TestSuite
class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Framework_SelfDescribing, IteratorAggregate (View source)
A TestSuite is a composite of Tests. It runs a collection of test cases.
Properties
protected bool | $backupGlobals | Enable or disable the backup and restoration of the $GLOBALS array. | |
protected bool | $backupStaticAttributes | Enable or disable the backup and restoration of static attributes. | |
protected bool | $runTestInSeparateProcess | ||
protected string | $name | The name of the test suite. | |
protected array | $groups | The test groups of the test suite. | |
protected array | $tests | The tests in the test suite. | |
protected int | $numTests | The number of tests in the test suite. | |
protected bool | $testCase | ||
protected array | $foundClasses |
Methods
Constructs a new TestSuite:
Returns a string representation of the test suite.
Adds the tests from the given class to the suite.
Wraps both addTest()
and addTestSuite
as well as the separate import statements for the user's convenience.
Counts the number of test cases that will be run by this test.
Creates a default TestResult object.
Returns the name of the suite.
Returns the test groups of the suite.
No description
Set tests groups of the test case
Runs the tests and collects their result in a TestResult.
No description
Sets the name of the suite.
Returns the test at the given index.
Returns the tests as an enumeration.
Set tests of the test suite
Mark the test suite as skipped.
No description
No description
No description
No description
No description
No description
Returns an iterator for this test suite.
Template Method that is called before the tests of this test suite are run.
Template Method that is called after the tests of this test suite have finished running.
Details
at line 112
__construct(mixed $theClass = '', string $name = '')
Constructs a new TestSuite:
PHPUnit_Framework_TestSuite() constructs an empty TestSuite.
PHPUnit_Framework_TestSuite(ReflectionClass) constructs a TestSuite from the given class.
PHPUnit_Framework_TestSuite(ReflectionClass, String) constructs a TestSuite from the given class with the given name.
PHPUnit_Framework_TestSuite(String) either constructs a TestSuite from the given class (if the passed string is the name of an existing class) or constructs an empty TestSuite with the given name.
at line 190
string
toString()
Returns a string representation of the test suite.
at line 201
addTest(PHPUnit_Framework_Test $test, array $groups = [])
Adds a test to the suite.
at line 239
addTestSuite(mixed $testClass)
Adds the tests from the given class to the suite.
at line 293
addTestFile(string $filename)
Wraps both addTest()
and addTestSuite
as well as the separate import statements for the user's convenience.
If the named file cannot be read or there are no new tests that can be
added, a PHPUnit_Framework_WarningTestCase
will be created instead,
leaving the current test run untouched.
at line 371
addTestFiles(array|Iterator $filenames)
Wrapper for addTestFile() that adds multiple test files.
at line 393
int
count(bool $preferCache = false)
Counts the number of test cases that will be run by this test.
at line 418
static PHPUnit_Framework_Test
createTest(ReflectionClass $theClass, string $name)
at line 596
protected PHPUnit_Framework_TestResult
createResult()
Creates a default TestResult object.
at line 606
string
getName()
Returns the name of the suite.
at line 616
array
getGroups()
Returns the test groups of the suite.
at line 621
getGroupDetails()
at line 631
setGroupDetails(array $groups)
Set tests groups of the test case
at line 643
PHPUnit_Framework_TestResult
run(PHPUnit_Framework_TestResult $result = null)
Runs the tests and collects their result in a TestResult.
at line 743
setRunTestInSeparateProcess(bool $runTestInSeparateProcess)
at line 760
runTest(PHPUnit_Framework_Test $test, PHPUnit_Framework_TestResult $result)
deprecated
deprecated
Runs a test.
at line 770
setName(string $name)
Sets the name of the suite.
at line 782
PHPUnit_Framework_Test
testAt(int|false $index)
Returns the test at the given index.
at line 796
array
tests()
Returns the tests as an enumeration.
at line 806
setTests(array $tests)
Set tests of the test suite
at line 818
markTestSuiteSkipped(string $message = '')
Mark the test suite as skipped.
at line 827
protected
addTestMethod(ReflectionClass $class, ReflectionMethod $method)
at line 869
static bool
isTestMethod(ReflectionMethod $method)
at line 888
static protected PHPUnit_Framework_WarningTestCase
warning(string $message)
at line 900
static protected PHPUnit_Framework_SkippedTestCase
skipTest(string $class, string $methodName, string $message)
at line 912
static protected PHPUnit_Framework_IncompleteTestCase
incompleteTest(string $class, string $methodName, string $message)
at line 920
setbeStrictAboutChangesToGlobalState(bool $beStrictAboutChangesToGlobalState)
at line 930
setBackupGlobals(bool $backupGlobals)
at line 940
setBackupStaticAttributes(bool $backupStaticAttributes)
at line 953
RecursiveIteratorIterator
getIterator()
Returns an iterator for this test suite.
at line 964
injectFilter(PHPUnit_Runner_Filter_Factory $filter)
at line 978
protected
setUp()
Template Method that is called before the tests of this test suite are run.
at line 986
protected
tearDown()
Template Method that is called after the tests of this test suite have finished running.