class TestResultCollection
@template-implements IteratorAggregate<int, TestResult>
@psalm-immutable
@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\Logging\TestDox\TestResultCollection implements \IteratorAggregate
Expanded class hierarchy of TestResultCollection
2 files declare their use of TestResultCollection
- Facade.php in vendor/
phpunit/ phpunit/ src/ TextUI/ Output/ Facade.php - ResultPrinter.php in vendor/
phpunit/ phpunit/ src/ TextUI/ Output/ TestDox/ ResultPrinter.php
File
-
vendor/
phpunit/ phpunit/ src/ Logging/ TestDox/ TestResult/ TestResultCollection.php, line 23
Namespace
PHPUnit\Logging\TestDoxView source
final class TestResultCollection implements IteratorAggregate {
/**
* @psalm-var list<TestResult>
*/
private readonly array $testResults;
/**
* @psalm-param list<TestResult> $testResults
*/
public static function fromArray(array $testResults) : self {
return new self(...$testResults);
}
private function __construct(TestResult ...$testResults) {
$this->testResults = $testResults;
}
/**
* @psalm-return list<TestResult>
*/
public function asArray() : array {
return $this->testResults;
}
public function getIterator() : TestResultCollectionIterator {
return new TestResultCollectionIterator($this);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
TestResultCollection::$testResults | private | property | @psalm-var list<TestResult> |
TestResultCollection::asArray | public | function | @psalm-return list<TestResult> |
TestResultCollection::fromArray | public static | function | @psalm-param list<TestResult> $testResults |
TestResultCollection::getIterator | public | function | |
TestResultCollection::__construct | private | function |