function RendererTest::testRenderWithAccessPropertyAndCallback

Ensures that the #access property wins over the callable.

@legacy-covers ::render @legacy-covers ::doRender

Attributes

#[DataProvider('providerAccessValues')]

File

core/tests/Drupal/Tests/Core/Render/RendererTest.php, line 636

Class

RendererTest
Tests Drupal\Core\Render\Renderer.

Namespace

Drupal\Tests\Core\Render

Code

public function testRenderWithAccessPropertyAndCallback($access) : void {
  $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.