->
willReturn($this->directories
['theme'
]);
$this->helpLoader =
new HelpTopicTwigLoader('\fake\root\path',
$module_handler,
$theme_handler);
} /**
* @covers ::__construct
*/
public function testConstructor() { // Verify that the module/theme directories were added in the constructor,
// and non-existent directories were omitted.
$paths =
$this->helpLoader->
getPaths(HelpTopicTwigLoader::MAIN_NAMESPACE
);
$this->
assertCount(2,
$paths);
$this->
assertContains($this->directories
['module'
]['test'
] . '/help_topics',
$paths);
$this->
assertContains($this->directories
['theme'
]['test'
] . '/help_topics',
$paths);
} /**
* @covers ::getSourceContext
*/
public function testGetSourceContext() { $source =
$this->helpLoader->
getSourceContext('@' . HelpTopicTwigLoader::MAIN_NAMESPACE . '/test.topic.html.twig'
);
$this->
assertEquals('{% line 4 %}<h2>Test</h2>',
$source->
getCode());
}