You are here

function TwigExtensionTest::testTwigExtensionLoaded in Zircon Profile 8

Same name and namespace in other branches
  1. 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\Theme

Code

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.');
}