public function HelpTopicDiscoveryTest::testDiscoveryExceptionMissingLabel in Drupal 8
Same name and namespace in other branches
- 9 core/modules/help_topics/tests/src/Unit/HelpTopicDiscoveryTest.php \Drupal\Tests\help_topics\Unit\HelpTopicDiscoveryTest::testDiscoveryExceptionMissingLabel()
@covers ::findAll
File
- core/
modules/ help_topics/ tests/ src/ Unit/ HelpTopicDiscoveryTest.php, line 44
Class
- HelpTopicDiscoveryTest
- @coversDefaultClass \Drupal\help_topics\HelpTopicDiscovery @group help_topics
Namespace
Drupal\Tests\help_topics\UnitCode
public function testDiscoveryExceptionMissingLabel() {
vfsStream::setup('root');
vfsStream::create([
'modules' => [
'test' => [
'help_topics' => [
// The content of the help topic does not matter.
'test.topic.html.twig' => '',
],
],
],
]);
$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 does not contain the required key with name='label'");
$discovery
->getDefinitions();
}