You are here

public function TwigExtensionTest::providerTestRenderVar in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php \Drupal\Tests\Core\Template\TwigExtensionTest::providerTestRenderVar()
  2. 9 core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php \Drupal\Tests\Core\Template\TwigExtensionTest::providerTestRenderVar()

File

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

Class

TwigExtensionTest
Tests the twig extension.

Namespace

Drupal\Tests\Core\Template

Code

public function providerTestRenderVar() {
  $data = [];
  $renderable = $this
    ->prophesize(RenderableInterface::class);
  $render_array = [
    '#type' => 'test',
    '#var' => 'giraffe',
  ];
  $renderable
    ->toRenderable()
    ->willReturn($render_array);
  $data['renderable'] = [
    $render_array,
    $renderable
      ->reveal(),
  ];
  return $data;
}