function RendererTest::testRenderWithAccessPropertyAndCallback
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Render/RendererTest.php \Drupal\Tests\Core\Render\RendererTest::testRenderWithAccessPropertyAndCallback()
- 10 core/tests/Drupal/Tests/Core/Render/RendererTest.php \Drupal\Tests\Core\Render\RendererTest::testRenderWithAccessPropertyAndCallback()
- 11.x core/tests/Drupal/Tests/Core/Render/RendererTest.php \Drupal\Tests\Core\Render\RendererTest::testRenderWithAccessPropertyAndCallback()
Ensures that the #access property wins over the callable.
@covers ::render @covers ::doRender
@dataProvider providerAccessValues
File
-
core/
tests/ Drupal/ Tests/ Core/ Render/ RendererTest.php, line 584
Class
- RendererTest
- @coversDefaultClass \Drupal\Core\Render\Renderer @group Render
Namespace
Drupal\Tests\Core\RenderCode
public function testRenderWithAccessPropertyAndCallback($access) {
$build = [
'#access' => $access,
'#access_callback' => function () {
return TRUE;
},
];
$this->assertAccess($build, $access);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.