You are here

public function TwigExtensionTest::testTwigExtensionFunction in Drupal 8

Same name and namespace in other branches
  1. 9 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
    ->assertText('THE QUICK BROWN BOX JUMPS OVER THE LAZY DOG 123.', 'Success: Text converted to uppercase.');
  $this
    ->assertText('the quick brown box jumps over the lazy dog 123.', 'Success: Text converted to lowercase.');
  $this
    ->assertNoText('The Quick Brown Fox Jumps Over The Lazy Dog 123.', 'Success: No text left behind.');
}