function TwigExtensionTest::providerTestRenderVar

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

File

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

Class

TwigExtensionTest
Tests the twig extension.

Namespace

Drupal\Tests\Core\Template

Code

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

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