You are here

public function RendererCallbackTest::testCallback in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Render/RendererCallbackTest.php \Drupal\Tests\Core\Render\RendererCallbackTest::testCallback()
  2. 10 core/tests/Drupal/Tests/Core/Render/RendererCallbackTest.php \Drupal\Tests\Core\Render\RendererCallbackTest::testCallback()

Tests the expected deprecations are triggered by Renderer::doCallback().

@dataProvider providerTestCallback

Parameters

array $render_array: The render array with a callback.

$expected_deprecation: The expected deprecation message triggered whilst rendering.

File

core/tests/Drupal/Tests/Core/Render/RendererCallbackTest.php, line 38

Class

RendererCallbackTest
@coversDefaultClass \Drupal\Core\Render\Renderer @group Render @group legacy Once Renderer::doCallback() throws exceptions this will no longer be a legacy test.

Namespace

Drupal\Tests\Core\Render

Code

public function testCallback(array $render_array, $expected_deprecation) {
  $this
    ->expectedDeprecations([
    $expected_deprecation,
  ]);
  $this->renderer
    ->renderRoot($render_array);
}