You are here

public function InfoParserUnitTest::testProfile in Drupal 10

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

Tests a profile info file.

File

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

Class

InfoParserUnitTest
Tests InfoParser class and exception.

Namespace

Drupal\Tests\Core\Extension

Code

public function testProfile() {
  $profile = <<<PROFILE_TEST
core_version_requirement: '*'
name: The Perfect Profile
type: profile
description: 'This profile makes Drupal perfect. You should have no complaints.'
PROFILE_TEST;
  vfsStream::setup('profiles');
  vfsStream::create([
    'fixtures' => [
      'invalid_profile.info.txt' => $profile,
    ],
  ]);
  $info = $this->infoParser
    ->parse(vfsStream::url('profiles/fixtures/invalid_profile.info.txt'));
  $this
    ->assertFalse($info['core_incompatible']);
}