function ExtensionVersionTest::testCreateFromSupportBranch

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

Tests create from support branch.

@legacy-covers ::createFromSupportBranch

Attributes

#[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 366

Class

ExtensionVersionTest
Tests 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.