You are here

public function EntityAccessCheckTest::testAnonymousAccessDeniedUsingKernel in Permissions by Term 8

Same name and namespace in other branches
  1. 8.2 modules/permissions_by_entity/tests/src/Kernel/EntityAccessCheckTest.php \Drupal\Tests\permissions_by_entity\Kernel\EntityAccessCheckTest::testAnonymousAccessDeniedUsingKernel()

Tests even listener based access control.

File

modules/permissions_by_entity/tests/src/Kernel/EntityAccessCheckTest.php, line 104

Class

EntityAccessCheckTest
Class EntityAccessCheckTest

Namespace

Drupal\Tests\permissions_by_entity\Kernel

Code

public function testAnonymousAccessDeniedUsingKernel() {
  $dispatcher = $this
    ->getPopulatedDispatcher();
  $this
    ->setExpectedException(AccessDeniedHttpException::class);
  $dispatcher
    ->dispatch(KernelEvents::REQUEST, $this
    ->getRequestResponseEvent());
}