You are here

public function ModuleVersionTest::testInvalidVersionNumber in Drupal 9

Same name and namespace in other branches
  1. 8 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 217

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);
}