You are here

public function ExtensionVersionTest::providerVersionInfos in Drupal 9

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Core/Extension/ExtensionVersionTest.php \Drupal\Tests\Core\Extension\ExtensionVersionTest::providerVersionInfos()

Data provider for expected version information.

Return value

mixed[][] Arrays of version information.

File

core/tests/Drupal/Tests/Core/Extension/ExtensionVersionTest.php, line 66

Class

ExtensionVersionTest
@coversDefaultClass \Drupal\Core\Extension\ExtensionVersion

Namespace

Drupal\Tests\Core\Extension

Code

public function providerVersionInfos() : array {

  // Data provider values are:
  // - The version number to test.
  // - Array of expected version information with the following keys:
  //   -'major': The expected result from ::getMajorVersion().
  //   -'extra': The expected result from ::getVersionExtra().
  return [
    '8.x-1.3' => [
      '8.x-1.3',
      [
        'major' => '1',
        'minor' => NULL,
        'extra' => NULL,
      ],
    ],
    '8.x-1.0' => [
      '8.x-1.0',
      [
        'major' => '1',
        'minor' => NULL,
        'extra' => NULL,
      ],
    ],
    '8.x-1.0-alpha1' => [
      '8.x-1.0-alpha1',
      [
        'major' => '1',
        'minor' => NULL,
        'extra' => 'alpha1',
      ],
    ],
    '8.x-1.3-alpha1' => [
      '8.x-1.3-alpha1',
      [
        'major' => '1',
        'minor' => NULL,
        'extra' => 'alpha1',
      ],
    ],
    '0.1' => [
      '0.1',
      [
        'major' => '0',
        'minor' => NULL,
        'extra' => NULL,
      ],
    ],
    '1.0' => [
      '1.0',
      [
        'major' => '1',
        'minor' => NULL,
        'extra' => NULL,
      ],
    ],
    '1.3' => [
      '1.3',
      [
        'major' => '1',
        'minor' => NULL,
        'extra' => NULL,
      ],
    ],
    '1.0-alpha1' => [
      '1.0-alpha1',
      [
        'major' => '1',
        'minor' => NULL,
        'extra' => 'alpha1',
      ],
    ],
    '1.3-alpha1' => [
      '1.3-alpha1',
      [
        'major' => '1',
        'minor' => NULL,
        'extra' => 'alpha1',
      ],
    ],
    '0.2.0' => [
      '0.2.0',
      [
        'major' => '0',
        'minor' => '2',
        'extra' => NULL,
      ],
    ],
    '1.2.0' => [
      '1.2.0',
      [
        'major' => '1',
        'minor' => '2',
        'extra' => NULL,
      ],
    ],
    '1.0.3' => [
      '1.0.3',
      [
        'major' => '1',
        'minor' => '0',
        'extra' => NULL,
      ],
    ],
    '1.2.3' => [
      '1.2.3',
      [
        'major' => '1',
        'minor' => '2',
        'extra' => NULL,
      ],
    ],
    '1.2.0-alpha1' => [
      '1.2.0-alpha1',
      [
        'major' => '1',
        'minor' => '2',
        'extra' => 'alpha1',
      ],
    ],
    '1.2.3-alpha1' => [
      '1.2.3-alpha1',
      [
        'major' => '1',
        'minor' => '2',
        'extra' => 'alpha1',
      ],
    ],
    '8.x-1.x-dev' => [
      '8.x-1.x-dev',
      [
        'major' => '1',
        'minor' => NULL,
        'extra' => 'dev',
      ],
    ],
    '8.x-8.x-dev' => [
      '8.x-8.x-dev',
      [
        'major' => '8',
        'minor' => NULL,
        'extra' => 'dev',
      ],
    ],
    '1.x-dev' => [
      '1.x-dev',
      [
        'major' => '1',
        'minor' => NULL,
        'extra' => 'dev',
      ],
    ],
    '8.x-dev' => [
      '8.x-dev',
      [
        'major' => '8',
        'minor' => NULL,
        'extra' => 'dev',
      ],
    ],
    '1.0.x-dev' => [
      '1.0.x-dev',
      [
        'major' => '1',
        'minor' => '0',
        'extra' => 'dev',
      ],
    ],
    '1.2.x-dev' => [
      '1.2.x-dev',
      [
        'major' => '1',
        'minor' => '2',
        'extra' => 'dev',
      ],
    ],
  ];
}