public function RendererTest::testRenderWithAccessControllerResolved in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Render/RendererTest.php \Drupal\Tests\Core\Render\RendererTest::testRenderWithAccessControllerResolved()
@covers ::render @covers ::doRender
@dataProvider providerAccessValues
File
- core/
tests/ Drupal/ Tests/ Core/ Render/ RendererTest.php, line 597 - Contains \Drupal\Tests\Core\Render\RendererTest.
Class
- RendererTest
- @coversDefaultClass \Drupal\Core\Render\Renderer @group Render
Namespace
Drupal\Tests\Core\RenderCode
public function testRenderWithAccessControllerResolved($access) {
switch ($access) {
case AccessResult::allowed():
$method = 'accessResultAllowed';
break;
case AccessResult::forbidden():
$method = 'accessResultForbidden';
break;
case FALSE:
$method = 'accessFalse';
break;
case TRUE:
$method = 'accessTrue';
break;
}
$build = [
'#access_callback' => 'Drupal\\Tests\\Core\\Render\\TestAccessClass::' . $method,
];
$this
->assertAccess($build, $access);
}