function HelpTopicDiscoveryTest::testHelpTopicsExtensionProviderSpecialCase

Same name and namespace in other branches
  1. 11.x core/modules/help/tests/src/Unit/HelpTopicDiscoveryTest.php \Drupal\Tests\help\Unit\HelpTopicDiscoveryTest::testHelpTopicsExtensionProviderSpecialCase()
  2. 10 core/modules/help/tests/src/Unit/HelpTopicDiscoveryTest.php \Drupal\Tests\help\Unit\HelpTopicDiscoveryTest::testHelpTopicsExtensionProviderSpecialCase()
  3. 8.9.x core/modules/help_topics/tests/src/Unit/HelpTopicDiscoveryTest.php \Drupal\Tests\help_topics\Unit\HelpTopicDiscoveryTest::testHelpTopicsExtensionProviderSpecialCase()

@covers ::findAll

File

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

Class

HelpTopicDiscoveryTest
@coversDefaultClass \Drupal\help_topics\HelpTopicDiscovery[[api-linebreak]] @group help_topics

Namespace

Drupal\Tests\help_topics\Unit

Code

public function testHelpTopicsExtensionProviderSpecialCase() {
  vfsStream::setup('root');
  $topic_content = <<<EOF
  ---
  label: Test
  ---
  <h2>Test</h2>
  EOF;
  vfsStream::create([
    'modules' => [
      'help_topics' => [
        'help_topics' => [
          'core.topic.html.twig' => $topic_content,
        ],
      ],
    ],
  ]);
  $discovery = new HelpTopicDiscovery([
    'help_topics' => vfsStream::url('root/modules/help_topics/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.