class TestCollection
@template-implements IteratorAggregate<int, Test>
@psalm-immutable
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Hierarchy
- class \PHPUnit\Event\Code\TestCollection implements \Countable, \IteratorAggregate
Expanded class hierarchy of TestCollection
4 files declare their use of TestCollection
- TestSuite.php in vendor/
phpunit/ phpunit/ src/ Event/ Value/ TestSuite/ TestSuite.php - TestSuiteBuilder.php in vendor/
phpunit/ phpunit/ src/ Event/ Value/ TestSuite/ TestSuiteBuilder.php - TestSuiteForTestClass.php in vendor/
phpunit/ phpunit/ src/ Event/ Value/ TestSuite/ TestSuiteForTestClass.php - TestSuiteForTestMethodWithDataProvider.php in vendor/
phpunit/ phpunit/ src/ Event/ Value/ TestSuite/ TestSuiteForTestMethodWithDataProvider.php
File
-
vendor/
phpunit/ phpunit/ src/ Event/ Value/ Test/ TestCollection.php, line 23
Namespace
PHPUnit\Event\CodeView source
final class TestCollection implements Countable, IteratorAggregate {
/**
* @psalm-var list<Test>
*/
private readonly array $tests;
/**
* @psalm-param list<Test> $tests
*/
public static function fromArray(array $tests) : self {
return new self(...$tests);
}
private function __construct(Test ...$tests) {
$this->tests = $tests;
}
/**
* @psalm-return list<Test>
*/
public function asArray() : array {
return $this->tests;
}
public function count() : int {
return count($this->tests);
}
public function getIterator() : TestCollectionIterator {
return new TestCollectionIterator($this);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
TestCollection::$tests | private | property | @psalm-var list<Test> |
TestCollection::asArray | public | function | @psalm-return list<Test> |
TestCollection::count | public | function | |
TestCollection::fromArray | public static | function | @psalm-param list<Test> $tests |
TestCollection::getIterator | public | function | |
TestCollection::__construct | private | function |