You are here

public function EngineTwigTest::testTwigVariableDataTypes in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php \Drupal\Tests\system\Functional\Theme\EngineTwigTest::testTwigVariableDataTypes()
  2. 9 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
      ->assertSession()
      ->responseContains('<li>' . $type . ': ' . $value['expected'] . '</li>');
  }
}