You are here

public function UrlTest::testRenderAccess in Drupal 8

Tests the renderAccess() method.

@covers ::renderAccess @dataProvider accessProvider

Parameters

bool $access:

File

core/tests/Drupal/Tests/Core/UrlTest.php, line 533
Contains \Drupal\Tests\Core\UrlTest.

Class

UrlTest
@coversDefaultClass \Drupal\Core\Url @group UrlTest

Namespace

Drupal\Tests\Core

Code

public function testRenderAccess($access) {
  $element = [
    '#url' => Url::fromRoute('entity.node.canonical', [
      'node' => 3,
    ]),
  ];
  $this->container
    ->set('current_user', $this
    ->createMock('Drupal\\Core\\Session\\AccountInterface'));
  $this->container
    ->set('access_manager', $this
    ->getMockAccessManager($access));
  $this
    ->assertEquals($access, TestUrl::renderAccess($element));
}