You are here

public function InfoParserUnitTest::testCore8xNoCoreVersionRequirement in Drupal 9

Tests an info file with 'core: 8.x' but without 'core_version_requirement'.

@covers ::parse

File

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

Class

InfoParserUnitTest
Tests InfoParser class and exception.

Namespace

Drupal\Tests\Core\Extension

Code

public function testCore8xNoCoreVersionRequirement() {
  $info = <<<INFO
package: Core
core: 8.x
version: VERSION
type: module
name: Module for That
dependencies:
  - field
INFO;
  vfsStream::setup('modules');
  foreach ([
    '1',
    '2',
  ] as $file_delta) {
    $filename = "core_version_requirement-{$file_delta}.info.txt";
    vfsStream::create([
      'fixtures' => [
        $filename => $info,
      ],
    ]);
    $info_values = $this->infoParser
      ->parse(vfsStream::url("modules/fixtures/{$filename}"));
    $this
      ->assertSame(TRUE, $info_values['core_incompatible'], "Expected 'core_incompatible's for file: {$filename}");
  }
}