function InfoParserUnitTest::testTestingPackageMissingCoreCoreVersionRequirement

Same name in other branches
  1. 8.9.x 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);
}

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