function ModuleVersionTest::createKeyedTestCases

Same name in other branches
  1. 9 core/modules/update/tests/src/Unit/ModuleVersionTest.php \Drupal\Tests\update\Unit\ModuleVersionTest::createKeyedTestCases()

Creates test case arrays for data provider methods.

Parameters

string[] $test_arguments: The test arguments.

Return value

array An array with $test_arguments as keys and each element of $test_arguments as a single item array

4 calls to ModuleVersionTest::createKeyedTestCases()
ModuleVersionTest::provideInvalidBranch in core/modules/update/tests/src/Unit/ModuleVersionTest.php
Data provider for testInvalidBranch().
ModuleVersionTest::providerInvalidBranchCorePrefix in core/modules/update/tests/src/Unit/ModuleVersionTest.php
Data provider for testInvalidBranchCorePrefix().
ModuleVersionTest::providerInvalidVersionCorePrefix in core/modules/update/tests/src/Unit/ModuleVersionTest.php
Data provider for testInvalidVersionCorePrefix().
ModuleVersionTest::providerInvalidVersionNumber in core/modules/update/tests/src/Unit/ModuleVersionTest.php
Data provider for testInvalidVersionNumber().

File

core/modules/update/tests/src/Unit/ModuleVersionTest.php, line 391

Class

ModuleVersionTest
@coversDefaultClass \Drupal\update\ModuleVersion

Namespace

Drupal\Tests\update\Unit

Code

protected static function createKeyedTestCases(array $test_arguments) {
    return array_combine($test_arguments, array_map(function ($test_argument) {
        return [
            $test_argument,
        ];
    }, $test_arguments));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.