function HelpTopicTwigLoaderTest::testGetSourceContext

Same name in other branches
  1. 9 core/modules/help_topics/tests/src/Unit/HelpTopicTwigLoaderTest.php \Drupal\Tests\help_topics\Unit\HelpTopicTwigLoaderTest::testGetSourceContext()
  2. 8.9.x core/modules/help_topics/tests/src/Unit/HelpTopicTwigLoaderTest.php \Drupal\Tests\help_topics\Unit\HelpTopicTwigLoaderTest::testGetSourceContext()
  3. 10 core/modules/help/tests/src/Unit/HelpTopicTwigLoaderTest.php \Drupal\Tests\help\Unit\HelpTopicTwigLoaderTest::testGetSourceContext()

@covers ::getSourceContext

File

core/modules/help/tests/src/Unit/HelpTopicTwigLoaderTest.php, line 73

Class

HelpTopicTwigLoaderTest
Unit test for the HelpTopicTwigLoader class.

Namespace

Drupal\Tests\help\Unit

Code

public function testGetSourceContext() : void {
    $source = $this->helpLoader
        ->getSourceContext('@' . HelpTopicTwigLoader::MAIN_NAMESPACE . '/test.topic.html.twig');
    $this->assertEquals('{% line 4 %}<h2>Test</h2>', $source->getCode());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.