function ExtensionVersionTest::testCreateFromSupportBranch

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Extension/ExtensionVersionTest.php \Drupal\Tests\Core\Extension\ExtensionVersionTest::testCreateFromSupportBranch()
  2. 11.x core/tests/Drupal/Tests/Core/Extension/ExtensionVersionTest.php \Drupal\Tests\Core\Extension\ExtensionVersionTest::testCreateFromSupportBranch()

@covers ::createFromSupportBranch

@dataProvider providerCreateFromSupportBranch

Parameters

string $branch: The branch to test.

string $expected_major: The expected major version.

File

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

Class

ExtensionVersionTest
@coversDefaultClass \Drupal\Core\Extension\ExtensionVersion

Namespace

Drupal\Tests\Core\Extension

Code

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

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