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

Breadcrumb

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

function TestDataCollection::ensureNoMoreThanOneDataFromDataProvider

@psalm-param list<TestData> $data

Throws

MoreThanOneDataSetFromDataProviderException

1 call to TestDataCollection::ensureNoMoreThanOneDataFromDataProvider()
TestDataCollection::__construct in vendor/phpunit/phpunit/src/Event/Value/Test/TestData/TestDataCollection.php

File

vendor/phpunit/phpunit/src/Event/Value/Test/TestData/TestDataCollection.php, line 92

Class

TestDataCollection
@template-implements IteratorAggregate<int, TestData>

Namespace

PHPUnit\Event\TestData

Code

private function ensureNoMoreThanOneDataFromDataProvider(array $data) : void {
    foreach ($data as $_data) {
        if ($_data->isFromDataProvider()) {
            if ($this->fromDataProvider !== null) {
                throw new MoreThanOneDataSetFromDataProviderException();
            }
            $this->fromDataProvider = $_data;
        }
    }
}
RSS feed
Powered by Drupal