function ModuleVersionTest::testInvalidVersionNumber

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

@covers ::createFromVersionString

@dataProvider providerInvalidVersionNumber

Parameters

string $version: The version string to test.

File

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

Class

ModuleVersionTest
@coversDefaultClass \Drupal\update\ModuleVersion

Namespace

Drupal\Tests\update\Unit

Code

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

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