function HelpTopicDiscoveryTest::testHelpTopicsInCore

Tests help topics in core.

@legacy-covers ::findAll

File

core/modules/help/tests/src/Unit/HelpTopicDiscoveryTest.php, line 171

Class

HelpTopicDiscoveryTest
Tests Drupal\help\HelpTopicDiscovery.

Namespace

Drupal\Tests\help\Unit

Code

public function testHelpTopicsInCore() : void {
  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());
}

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