function ModuleVersionTest::testCreateFromSupportBranch

Same name in other branches
  1. 9 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 310

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.