Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TestResultCollection.php

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\TestDox
View 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&lt;TestResult&gt;
TestResultCollection::asArray public function @psalm-return list&lt;TestResult&gt;
TestResultCollection::fromArray public static function @psalm-param list&lt;TestResult&gt; $testResults
TestResultCollection::getIterator public function
TestResultCollection::__construct private function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal