You are here

public function PreviewLinkAccessTest::testPreviewAccessAllowed in Preview Link 2.0.x

Same name and namespace in other branches
  1. 8 tests/src/Kernel/PreviewLinkAccessTest.php \Drupal\Tests\preview_link\Kernel\PreviewLinkAccessTest::testPreviewAccessAllowed()
  2. 2.x tests/src/Kernel/PreviewLinkAccessTest.php \Drupal\Tests\preview_link\Kernel\PreviewLinkAccessTest::testPreviewAccessAllowed()

Ensure access is allowed with a valid token.

File

tests/src/Kernel/PreviewLinkAccessTest.php, line 85

Class

PreviewLinkAccessTest
Test preview link access.

Namespace

Drupal\Tests\preview_link\Kernel

Code

public function testPreviewAccessAllowed() : void {
  $access = $this->container
    ->get('access_check.preview_link')
    ->access($this->node, $this->previewLink
    ->getToken());
  $this
    ->assertEquals(TRUE, $access
    ->isAllowed());
}