function EngineTwigTest::testTwigVariableDataTypes

Tests that the Twig engine handles PHP data correctly.

File

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

Class

EngineTwigTest
Tests Twig-specific theme functionality.

Namespace

Drupal\Tests\system\Functional\Theme

Code

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

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