You are here

public function InfoParserUnitTest::testTestingPackageMissingCoreVersionRequirement in Drupal 10

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 testTestingPackageMissingCoreVersionRequirement() {
  $missing_core_version_requirement = <<<MISSING_CORE_VERSION_REQUIREMENT
# info.yml for testing core_version_requirement.
package: Testing
version: VERSION
type: module
name: Skynet
MISSING_CORE_VERSION_REQUIREMENT;
  vfsStream::setup('modules');
  vfsStream::create([
    'fixtures' => [
      'missing_core_version_requirement.info.txt' => $missing_core_version_requirement,
    ],
  ]);
  $info_values = $this->infoParser
    ->parse(vfsStream::url('modules/fixtures/missing_core_version_requirement.info.txt'));
  $this
    ->assertSame($info_values['core_version_requirement'], \Drupal::VERSION);
}