You are here

public function ModuleVersionTest::testInvalidVersionCorePrefix 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::testInvalidVersionCorePrefix()

@covers ::createFromVersionString

@dataProvider providerInvalidVersionCorePrefix

Parameters

string $version: The version string to test.

File

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

Class

ModuleVersionTest
@coversDefaultClass \Drupal\update\ModuleVersion

Namespace

Drupal\Tests\update\Unit

Code

public function testInvalidVersionCorePrefix($version) {
  $this
    ->expectException(\UnexpectedValueException::class);
  $this
    ->expectExceptionMessage("Unexpected version core prefix in {$version}. The only core prefix expected in \\Drupal\\update\\ModuleVersion is: 8.x-");
  ModuleVersion::createFromVersionString($version);
}