class DataProviderTestSuite
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
@internal This class is not covered by the backward compatibility promise for PHPUnit
Hierarchy
- class \PHPUnit\Framework\TestSuite implements \IteratorAggregate, \PHPUnit\Framework\Reorderable, \PHPUnit\Framework\SelfDescribing, \PHPUnit\Framework\Test
- class \PHPUnit\Framework\DataProviderTestSuite extends \PHPUnit\Framework\TestSuite
Expanded class hierarchy of DataProviderTestSuite
2 files declare their use of DataProviderTestSuite
- TestSuiteBuilder.php in vendor/
phpunit/ phpunit/ src/ Event/ Value/ TestSuite/ TestSuiteBuilder.php - TestSuiteSorter.php in vendor/
phpunit/ phpunit/ src/ Runner/ TestSuiteSorter.php
File
-
vendor/
phpunit/ phpunit/ src/ Framework/ DataProviderTestSuite.php, line 21
Namespace
PHPUnit\FrameworkView source
final class DataProviderTestSuite extends TestSuite {
/**
* @psalm-var list<ExecutionOrderDependency>
*/
private array $dependencies = [];
private ?array $providedTests = null;
/**
* @psalm-param list<ExecutionOrderDependency> $dependencies
*/
public function setDependencies(array $dependencies) : void {
$this->dependencies = $dependencies;
foreach ($this->tests() as $test) {
if (!$test instanceof TestCase) {
continue;
}
$test->setDependencies($dependencies);
}
}
/**
* @psalm-return list<ExecutionOrderDependency>
*/
public function provides() : array {
if ($this->providedTests === null) {
$this->providedTests = [
new ExecutionOrderDependency($this->name()),
];
}
return $this->providedTests;
}
/**
* @psalm-return list<ExecutionOrderDependency>
*/
public function requires() : array {
// A DataProviderTestSuite does not have to traverse its child tests
// as these are inherited and cannot reference dataProvider rows directly
return $this->dependencies;
}
/**
* Returns the size of each test created using the data provider(s).
*/
public function size() : TestSize {
[
$className,
$methodName,
] = explode('::', $this->name());
return (new Groups())->size($className, $methodName);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
DataProviderTestSuite::$dependencies | private | property | @psalm-var list<ExecutionOrderDependency> | |
DataProviderTestSuite::$providedTests | private | property | @psalm-var ?list<ExecutionOrderDependency> | Overrides TestSuite::$providedTests |
DataProviderTestSuite::provides | public | function | @psalm-return list<ExecutionOrderDependency> | Overrides TestSuite::provides |
DataProviderTestSuite::requires | public | function | @psalm-return list<ExecutionOrderDependency> | Overrides TestSuite::requires |
DataProviderTestSuite::setDependencies | public | function | @psalm-param list<ExecutionOrderDependency> $dependencies | |
DataProviderTestSuite::size | public | function | Returns the size of each test created using the data provider(s). | |
TestSuite::$groups | private | property | @psalm-var array<string,list<Test>> | |
TestSuite::$iteratorFilter | private | property | ||
TestSuite::$name | private | property | @psalm-var non-empty-string | |
TestSuite::$requiredTests | private | property | @psalm-var ?list<ExecutionOrderDependency> | |
TestSuite::$tests | private | property | @psalm-var list<Test> | |
TestSuite::$wasRun | private | property | ||
TestSuite::addTest | public | function | Adds a test to the suite. | |
TestSuite::addTestFile | public | function | Wraps both <code>addTest()</code> and <code>addTestSuite</code> as well as the separate import statements for the user's convenience. |
|
TestSuite::addTestFiles | public | function | Wrapper for addTestFile() that adds multiple test files. | |
TestSuite::addTestMethod | protected | function | ||
TestSuite::addTestSuite | public | function | Adds the tests from the given class to the suite. | |
TestSuite::clearCaches | private | function | ||
TestSuite::containsOnlyVirtualGroups | private | function | ||
TestSuite::count | public | function | Counts the number of test cases that will be run by this test. | |
TestSuite::empty | public static | function | @psalm-param non-empty-string $name | |
TestSuite::fromClassName | public static | function | @psalm-param class-string $className | |
TestSuite::fromClassReflector | public static | function | ||
TestSuite::getIterator | public | function | Returns an iterator for this test suite. | |
TestSuite::groupDetails | public | function | ||
TestSuite::groups | public | function | Returns the test groups of the suite. | |
TestSuite::injectFilter | public | function | ||
TestSuite::invokeMethodsAfterLastTest | private | function | ||
TestSuite::invokeMethodsBeforeFirstTest | private | function | ||
TestSuite::isEmpty | public | function | ||
TestSuite::isForTestClass | public | function | @psalm-assert-if-true class-string $this->name | |
TestSuite::markTestSuiteSkipped | public | function | Mark the test suite as skipped. | |
TestSuite::methodDoesNotExistOrIsDeclaredInTestCase | private | function | ||
TestSuite::name | public | function | @psalm-return non-empty-string | |
TestSuite::run | public | function | Overrides Test::run | |
TestSuite::setTests | public | function | Set tests of the test suite. | |
TestSuite::sortId | public | function | Overrides Reorderable::sortId | |
TestSuite::tests | public | function | Returns the tests as an enumeration. | |
TestSuite::throwableToString | private | function | ||
TestSuite::toString | public | function | Returns a string representation of the test suite. | Overrides SelfDescribing::toString |
TestSuite::__construct | final private | function | @psalm-param non-empty-string $name |