public function PreviewLinkAccessTest::testPreviewAccessDenied in Preview Link 8
Same name and namespace in other branches
- 2.x tests/src/Kernel/PreviewLinkAccessTest.php \Drupal\Tests\preview_link\Kernel\PreviewLinkAccessTest::testPreviewAccessDenied()
- 2.0.x tests/src/Kernel/PreviewLinkAccessTest.php \Drupal\Tests\preview_link\Kernel\PreviewLinkAccessTest::testPreviewAccessDenied()
Test the preview access service.
@dataProvider previewAccessDeniedDataProvider
File
- tests/
src/ Kernel/ PreviewLinkAccessTest.php, line 46
Class
- PreviewLinkAccessTest
- Test preview link access.
Namespace
Drupal\Tests\preview_link\KernelCode
public function testPreviewAccessDenied($entity_type_id, $entity_id, $token, $expected_result) {
$entity = $this->container
->get('entity_type.manager')
->getStorage($entity_type_id)
->load($entity_id);
$access = $this->container
->get('access_check.preview_link')
->access($entity, $token);
$this
->assertEquals($expected_result, $access
->isAllowed());
}