You are here

public function HelpTopicDiscoveryTest::testHelpTopicsInCore in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/help_topics/tests/src/Unit/HelpTopicDiscoveryTest.php \Drupal\Tests\help_topics\Unit\HelpTopicDiscoveryTest::testHelpTopicsInCore()

@covers ::findAll

File

core/modules/help_topics/tests/src/Unit/HelpTopicDiscoveryTest.php, line 176

Class

HelpTopicDiscoveryTest
@coversDefaultClass \Drupal\help_topics\HelpTopicDiscovery @group help_topics

Namespace

Drupal\Tests\help_topics\Unit

Code

public function testHelpTopicsInCore() {
  vfsStream::setup('root');
  $topic_content = <<<EOF
---
label: Test
---
<h2>Test</h2>
EOF;
  vfsStream::create([
    'core' => [
      'help_topics' => [
        'core.topic.html.twig' => $topic_content,
      ],
    ],
  ]);
  $discovery = new HelpTopicDiscovery([
    'core' => vfsStream::url('root/core/help_topics'),
  ]);
  $this
    ->assertArrayHasKey('core.topic', $discovery
    ->getDefinitions());
}