You are here

public function InfoParserUnitTest::testTestingPackageMissingCoreCoreVersionRequirement in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php \Drupal\Tests\Core\Extension\InfoParserUnitTest::testTestingPackageMissingCoreCoreVersionRequirement()

Tests that Testing package modules use a default core_version_requirement.

@covers ::parse

File

core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php, line 149

Class

InfoParserUnitTest
Tests InfoParser class and exception.

Namespace

Drupal\Tests\Core\Extension

Code

public function testTestingPackageMissingCoreCoreVersionRequirement() {
  $missing_core_and_core_version_requirement = <<<MISSING_CORE_AND_CORE_VERSION_REQUIREMENT
# info.yml for testing core and core_version_requirement.
package: Testing
version: VERSION
type: module
name: Skynet
MISSING_CORE_AND_CORE_VERSION_REQUIREMENT;
  vfsStream::setup('modules');
  vfsStream::create([
    'fixtures' => [
      'missing_core_and_core_version_requirement.info.txt' => $missing_core_and_core_version_requirement,
    ],
  ]);
  $info_values = $this->infoParser
    ->parse(vfsStream::url('modules/fixtures/missing_core_and_core_version_requirement.info.txt'));
  $this
    ->assertSame($info_values['core_version_requirement'], \Drupal::VERSION);
}