function RendererTest::testRenderWithAccessControllerResolved
Tests render with access controller resolved.
@legacy-covers ::render @legacy-covers ::doRender
Attributes
#[DataProvider('providerAccessValues')]
File
-
core/
tests/ Drupal/ Tests/ Core/ Render/ RendererTest.php, line 654
Class
Namespace
Drupal\Tests\Core\RenderCode
public function testRenderWithAccessControllerResolved($access) : void {
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);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.