function TwigDeprecationsTest::testUndefinedDeprecation

Same name in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Theme/TwigDeprecationsTest.php \Drupal\KernelTests\Core\Theme\TwigDeprecationsTest::testUndefinedDeprecation()

Test deprecation of undefined variable triggers no error.

File

core/tests/Drupal/KernelTests/Core/Theme/TwigDeprecationsTest.php, line 50

Class

TwigDeprecationsTest
Tests deprecating variables passed to twig templates.

Namespace

Drupal\KernelTests\Core\Theme

Code

public function testUndefinedDeprecation() : void {
    $preprocess = [
        'deprecations' => [
            'undefined' => $this->getDeprecationMessage('undefined'),
        ],
    ];
    $this->assertRendered('foo|set_var|bar', $preprocess);
}

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