function RendererCallbackTest::testCallback
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Render/RendererCallbackTest.php \Drupal\Tests\Core\Render\RendererCallbackTest::testCallback()
- 10 core/tests/Drupal/Tests/Core/Render/RendererCallbackTest.php \Drupal\Tests\Core\Render\RendererCallbackTest::testCallback()
- 9 core/tests/Drupal/Tests/Core/Render/RendererCallbackTest.php \Drupal\Tests\Core\Render\RendererCallbackTest::testCallback()
- 8.9.x core/tests/Drupal/Tests/Core/Render/RendererCallbackTest.php \Drupal\Tests\Core\Render\RendererCallbackTest::testCallback()
Tests the expected deprecations are triggered by Renderer::doCallback().
Attributes
#[DataProvider('providerTestCallback')]
Parameters
array $render_array: The render array with a callback.
string $expected_deprecation: The expected deprecation message triggered whilst rendering.
File
-
core/
tests/ Drupal/ Tests/ Core/ Render/ RendererCallbackTest.php, line 38
Class
Namespace
Drupal\Tests\Core\RenderCode
public function testCallback(array $render_array, string $expected_deprecation) : void {
$this->expectException(UntrustedCallbackException::class);
$this->expectExceptionMessage($expected_deprecation);
$this->renderer
->renderRoot($render_array);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.