function ModuleVersionTest::providerCreateFromSupportBranch

Same name and namespace in other branches
  1. 8.9.x core/modules/update/tests/src/Unit/ModuleVersionTest.php \Drupal\Tests\update\Unit\ModuleVersionTest::providerCreateFromSupportBranch()

Data provider for testCreateFromSupportBranch().

File

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

Class

ModuleVersionTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21update%21src%21ModuleVersion.php/class/ModuleVersion/9" title="Provides a module version value object." class="local">\Drupal\update\ModuleVersion</a>

Namespace

Drupal\Tests\update\Unit

Code

public function providerCreateFromSupportBranch() {
    // 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 [
        '0.' => [
            '0.',
            '0',
        ],
        '1.' => [
            '1.',
            '1',
        ],
        '0.1.' => [
            '0.1.',
            '0',
        ],
        '1.2.' => [
            '1.2.',
            '1',
        ],
        '8.x-1.' => [
            '8.x-1.',
            '1',
        ],
    ];
}

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