function HelpTopicDiscoveryTest::testDiscoveryExceptionInvalidTopLevel
@covers ::findAll
      
    
File
- 
              core/
modules/ help/ tests/ src/ Unit/ HelpTopicDiscoveryTest.php, line 75  
Class
- HelpTopicDiscoveryTest
 - @coversDefaultClass \Drupal\help\HelpTopicDiscovery[[api-linebreak]] @group help
 
Namespace
Drupal\Tests\help\UnitCode
public function testDiscoveryExceptionInvalidTopLevel() : void {
  vfsStream::setup('root');
  $topic_content = <<<EOF
  ---
  label: 'A label'
  top_level: bar
  ---
  EOF;
  vfsStream::create([
    'modules' => [
      'test' => [
        'help_topics' => [
          'test.topic.html.twig' => $topic_content,
        ],
      ],
    ],
  ]);
  $discovery = new HelpTopicDiscovery([
    'test' => vfsStream::url('root/modules/test/help_topics'),
  ]);
  $this->expectException(DiscoveryException::class);
  $this->expectExceptionMessage("vfs://root/modules/test/help_topics/test.topic.html.twig contains invalid value for 'top_level' key, the value must be a Boolean");
  $discovery->getDefinitions();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.