function ExtensionVersionTest::testInvalidVersionNumber

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

@covers ::createFromVersionString

@dataProvider providerInvalidVersionNumber

Parameters

string $version: The version string to test.

File

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

Class

ExtensionVersionTest
@coversDefaultClass \Drupal\Core\Extension\ExtensionVersion

Namespace

Drupal\Tests\Core\Extension

Code

public function testInvalidVersionNumber(string $version) : void {
    $this->expectException(\UnexpectedValueException::class);
    $this->expectExceptionMessage("Unexpected version number in: {$version}");
    ExtensionVersion::createFromVersionString($version);
}

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