You are here

function TwigExtensionTest::testTwigExtensionFunction 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::testTwigExtensionFunction()

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

File

core/modules/system/src/Tests/Theme/TwigExtensionTest.php, line 57
Contains \Drupal\system\Tests\Theme\TwigExtensionTest.

Class

TwigExtensionTest
Tests Twig extensions.

Namespace

Drupal\system\Tests\Theme

Code

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