function TwigExtensionTest::testRenderVar

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php \Drupal\Tests\Core\Template\TwigExtensionTest::testRenderVar()
  2. 10 core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php \Drupal\Tests\Core\Template\TwigExtensionTest::testRenderVar()
  3. 11.x core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php \Drupal\Tests\Core\Template\TwigExtensionTest::testRenderVar()

@dataProvider providerTestRenderVar

File

core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php, line 283

Class

TwigExtensionTest
Tests the twig extension.

Namespace

Drupal\Tests\Core\Template

Code

public function testRenderVar($result, $input) {
    $this->renderer
        ->expects($this->any())
        ->method('render')
        ->with($result += [
        '#printed' => FALSE,
    ])
        ->willReturn('Rendered output');
    $this->assertEquals('Rendered output', $this->systemUnderTest
        ->renderVar($input));
}

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