function HelpTopicDiscoveryTest::testDiscoveryExceptionInvalidRelated
Same name in other branches
- 9 core/modules/help_topics/tests/src/Unit/HelpTopicDiscoveryTest.php \Drupal\Tests\help_topics\Unit\HelpTopicDiscoveryTest::testDiscoveryExceptionInvalidRelated()
- 8.9.x core/modules/help_topics/tests/src/Unit/HelpTopicDiscoveryTest.php \Drupal\Tests\help_topics\Unit\HelpTopicDiscoveryTest::testDiscoveryExceptionInvalidRelated()
- 11.x core/modules/help/tests/src/Unit/HelpTopicDiscoveryTest.php \Drupal\Tests\help\Unit\HelpTopicDiscoveryTest::testDiscoveryExceptionInvalidRelated()
@covers ::findAll
File
-
core/
modules/ help/ tests/ src/ Unit/ HelpTopicDiscoveryTest.php, line 103
Class
- HelpTopicDiscoveryTest
- @coversDefaultClass \Drupal\help\HelpTopicDiscovery @group help
Namespace
Drupal\Tests\help\UnitCode
public function testDiscoveryExceptionInvalidRelated() : void {
vfsStream::setup('root');
$topic_content = <<<EOF
---
label: 'A label'
related: "one, two"
---
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 'related' key, the value must be an array of strings");
$discovery->getDefinitions();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.