function TwigExtensionTest::testTwigExtensionLoaded in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/src/Tests/Theme/TwigExtensionTest.php \Drupal\system\Tests\Theme\TwigExtensionTest::testTwigExtensionLoaded()
Tests that the provided Twig extension loads the service appropriately.
File
- core/
modules/ system/ src/ Tests/ Theme/ TwigExtensionTest.php, line 34 - Contains \Drupal\system\Tests\Theme\TwigExtensionTest.
Class
- TwigExtensionTest
- Tests Twig extensions.
Namespace
Drupal\system\Tests\ThemeCode
function testTwigExtensionLoaded() {
$twigService = \Drupal::service('twig');
$ext = $twigService
->getExtension('twig_extension_test.test_extension');
$this
->assertEqual(get_class($ext), 'Drupal\\twig_extension_test\\TwigExtension\\TestExtension', 'TestExtension loaded successfully.');
}