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

Breadcrumb

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

function TestMethodBuilder::dataFor

Throws

MoreThanOneDataSetFromDataProviderException

1 call to TestMethodBuilder::dataFor()
TestMethodBuilder::fromTestCase in vendor/phpunit/phpunit/src/Event/Value/Test/TestMethodBuilder.php

File

vendor/phpunit/phpunit/src/Event/Value/Test/TestMethodBuilder.php, line 73

Class

TestMethodBuilder
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\Event\Code

Code

private static function dataFor(TestCase $testCase) : TestDataCollection {
    $testData = [];
    if ($testCase->usesDataProvider()) {
        $dataSetName = $testCase->dataName();
        if (is_numeric($dataSetName)) {
            $dataSetName = (int) $dataSetName;
        }
        $testData[] = DataFromDataProvider::from($dataSetName, Exporter::export($testCase->providedData(), EventFacade::emitter()->exportsObjects()), $testCase->dataSetAsStringWithData());
    }
    if ($testCase->hasDependencyInput()) {
        $testData[] = DataFromTestDependency::from(Exporter::export($testCase->dependencyInput(), EventFacade::emitter()->exportsObjects()));
    }
    return TestDataCollection::fromArray($testData);
}
RSS feed
Powered by Drupal