diff --git a/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php b/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php index 9fe767f2ce..4effd45e6e 100644 --- a/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php @@ -460,4 +460,31 @@ public function testInvalidProfile() { $this->infoParser->parse(vfsStream::url('profiles/fixtures/invalid_profile.info.txt')); } + /** + * Tests the exception for an unparsable 'core_version_requirement' value . + * + * @covers ::parse + */ + public function testUnparsableCoreVersionRequirement() { + $unparsable_core_version_requirement = << [ + 'unparsable_core_version_requirement.info.txt' => $unparsable_core_version_requirement, + ], + ]); + $this->expectException(\UnexpectedValueException::class); + $this->expectExceptionMessage('Could not parse version constraint not-this-version: Invalid version string "not-this-version"'); + $this->infoParser->parse(vfsStream::url('modules/fixtures/unparsable_core_version_requirement.info.txt')); + } + }