You are here

public function TwigExtensionTest::testTwigExtensionFunction in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php \Drupal\Tests\system\Functional\Theme\TwigExtensionTest::testTwigExtensionFunction()
  2. 10 core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php \Drupal\Tests\system\Functional\Theme\TwigExtensionTest::testTwigExtensionFunction()

Tests that the Twig extension's function produces expected output.

File

core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php, line 58

Class

TwigExtensionTest
Tests Twig extensions.

Namespace

Drupal\Tests\system\Functional\Theme

Code

public function testTwigExtensionFunction() {
  $this
    ->config('system.theme')
    ->set('default', 'test_theme')
    ->save();
  $this
    ->drupalGet('twig-extension-test/function');
  $this
    ->assertSession()
    ->pageTextContains('THE QUICK BROWN BOX JUMPS OVER THE LAZY DOG 123.');
  $this
    ->assertSession()
    ->pageTextContains('the quick brown box jumps over the lazy dog 123.');
  $this
    ->assertSession()
    ->pageTextNotContains('The Quick Brown Fox Jumps Over The Lazy Dog 123.');
}