function ModuleVersionTest::testCreateFromSupportBranch

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

@covers ::createFromSupportBranch

@dataProvider providerCreateFromSupportBranch

Parameters

string $branch: The branch to test.

string $expected_major: The expected major version.

File

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

Class

ModuleVersionTest
@coversDefaultClass \Drupal\update\ModuleVersion

Namespace

Drupal\Tests\update\Unit

Code

public function testCreateFromSupportBranch($branch, $expected_major) {
    $version = ModuleVersion::createFromSupportBranch($branch);
    $this->assertInstanceOf(ModuleVersion::class, $version);
    $this->assertSame($expected_major, $version->getMajorVersion());
    // Version extra can't be determined from a branch.
    $this->assertSame(NULL, $version->getVersionExtra());
}

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