\PHPUnit_Framework_TestSuite

A TestSuite is a composite of Tests. It runs a collection of test cases.

Here is an example using the dynamic test definition.

<code>
<?php
$suite = new PHPUnit_Framework_TestSuite;
$suite->addTest(new MathTest('testPass'));
?>
</code>

Alternatively, a TestSuite can extract the tests to be run automatically.
To do so you pass a ReflectionClass instance for your
PHPUnit_Framework_TestCase class to the PHPUnit_Framework_TestSuite
constructor.

<code>
<?php
$suite = new PHPUnit_Framework_TestSuite(
new ReflectionClass('MathTest')
);
?>
</code>

This constructor creates a suite with all the methods starting with
"test" that take no arguments.

Synopsis

class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test,PHPUnit_Framework_SelfDescribing,IteratorAggregate {
}

Hierarchy

Violations

PHPMessDetector

Line Rule Message
167 - 238 CyclomaticComplexity The method __construct() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10.
167 - 238 NPathComplexity The method __construct() has an NPath complexity of 768. The configured NPath complexity threshold is 200.
289 - 329 CyclomaticComplexity The method addTestSuite() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
347 - 415 CyclomaticComplexity The method addTestFile() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
347 - 415 NPathComplexity The method addTestFile() has an NPath complexity of 288. The configured NPath complexity threshold is 200.
461 - 628 CyclomaticComplexity The method createTest() has a Cyclomatic Complexity of 28. The configured cyclomatic complexity threshold is 10.
461 - 628 NPathComplexity The method createTest() has an NPath complexity of 15548. The configured NPath complexity threshold is 200.
461 - 628 ExcessiveMethodLength The method createTest() has 168 lines of code. Current threshold is set to 100. Avoid really long methods.
683 - 765 CyclomaticComplexity The method run() has a Cyclomatic Complexity of 20. The configured cyclomatic complexity threshold is 10.
683 - 765 NPathComplexity The method run() has an NPath complexity of 1400. The configured NPath complexity threshold is 200.

Checkstyle

Line Column Severity Message
495 13 error Expected "} else {\n"; found "} // TestCase($name, $data)\n else {\n"
502 134 warning Line exceeds 120 characters; contains 133 characters
704 125 warning Line exceeds 120 characters; contains 124 characters
755 129 warning Line exceeds 120 characters; contains 128 characters

Members

private

protected

  • $backupGlobals — boolean
    Enable or disable the backup and restoration of the $GLOBALS array.
  • $backupStaticAttributes — boolean
    Enable or disable the backup and restoration of static attributes.
  • $foundClasses — array
  • $groups — array
    The test groups of the test suite.
  • $name — string
    The name of the test suite.
  • $numTests — integer
    The number of tests in the test suite.
  • $runTestInSeparateProcess — boolean
  • $testCase — boolean
  • $tests — array
    The tests in the test suite.

Methods

protected

public

History