function RenderTest::testDeprecateRenderPlain

Same name in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Render/RenderTest.php \Drupal\KernelTests\Core\Render\RenderTest::testDeprecateRenderPlain()

Tests the deprecation of \Drupal\Core\Render\Renderer::renderPlain()

@group legacy

File

core/tests/Drupal/KernelTests/Core/Render/RenderTest.php, line 80

Class

RenderTest
Performs functional tests on \Drupal::service('renderer')->render().

Namespace

Drupal\KernelTests\Core\Render

Code

public function testDeprecateRenderPlain() : void {
    $message = [
        '#markup' => 'Test',
    ];
    \Drupal::service('renderer')->renderPlain($message);
    $this->expectDeprecation('Renderer::renderPlain() is deprecated in drupal:10.3.0 and is removed from drupal:12.0.0. Instead, you should use ::renderInIsolation(). See https://www.drupal.org/node/3407994');
}

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