protected function HelpTopicTwigTest::getTwigMock in Drupal 8
Same name and namespace in other branches
- 9 core/modules/help_topics/tests/src/Unit/HelpTopicTwigTest.php \Drupal\Tests\help_topics\Unit\HelpTopicTwigTest::getTwigMock()
Creates a mock Twig loader class for the test.
1 call to HelpTopicTwigTest::getTwigMock()
- HelpTopicTwigTest::setUp in core/
modules/ help_topics/ tests/ src/ Unit/ HelpTopicTwigTest.php
File
- core/
modules/ help_topics/ tests/ src/ Unit/ HelpTopicTwigTest.php, line 91
Class
- HelpTopicTwigTest
- Unit test for the HelpTopicTwig class.
Namespace
Drupal\Tests\help_topics\UnitCode
protected function getTwigMock() {
$twig = $this
->getMockBuilder('Drupal\\Core\\Template\\TwigEnvironment')
->disableOriginalConstructor()
->getMock();
$twig
->method('load')
->willReturn(new FakeTemplateWrapper(self::PLUGIN_INFORMATION['body']));
return $twig;
}