You are here

public function TwigExtensionTest::testRenderVar in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 222
Contains \Drupal\Tests\Core\Template\TwigExtensionTest.

Class

TwigExtensionTest
Tests the twig extension.

Namespace

Drupal\Tests\Core\Template

Code

public function testRenderVar($result, $input) {
  $renderer = $this
    ->prophesize(RendererInterface::class);
  $renderer
    ->render($result += [
    '#printed' => FALSE,
  ])
    ->willReturn('Rendered output');
  $renderer = $renderer
    ->reveal();
  $twig_extension = new TwigExtension($renderer);
  $this
    ->assertEquals('Rendered output', $twig_extension
    ->renderVar($input));
}