function ModuleVersionTest::testInvalidVersionCorePrefix

Same name in other branches
  1. 9 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 256

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

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