function EngineTwigTest::testTwigVariableDataTypes

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php \Drupal\Tests\system\Functional\Theme\EngineTwigTest::testTwigVariableDataTypes()
  2. 10 core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php \Drupal\Tests\system\Functional\Theme\EngineTwigTest::testTwigVariableDataTypes()
  3. 11.x core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php \Drupal\Tests\system\Functional\Theme\EngineTwigTest::testTwigVariableDataTypes()

Tests that the Twig engine handles PHP data correctly.

File

core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php, line 39

Class

EngineTwigTest
Tests Twig-specific theme functionality.

Namespace

Drupal\Tests\system\Functional\Theme

Code

public function testTwigVariableDataTypes() {
    $this->config('system.theme')
        ->set('default', 'test_theme')
        ->save();
    $this->drupalGet('twig-theme-test/php-variables');
    foreach (_test_theme_twig_php_values() as $type => $value) {
        $this->assertRaw('<li>' . $type . ': ' . $value['expected'] . '</li>');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.