You are here

public function RendererTest::testRenderWithAccessPropertyAndCallback in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Render/RendererTest.php \Drupal\Tests\Core\Render\RendererTest::testRenderWithAccessPropertyAndCallback()
  2. 10 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 580
Contains \Drupal\Tests\Core\Render\RendererTest.

Class

RendererTest
@coversDefaultClass \Drupal\Core\Render\Renderer @group Render

Namespace

Drupal\Tests\Core\Render

Code

public function testRenderWithAccessPropertyAndCallback($access) {
  $build = [
    '#access' => $access,
    '#access_callback' => function () {
      return TRUE;
    },
  ];
  $this
    ->assertAccess($build, $access);
}