You are here

public function EntityAccessCheckTest::testAuthenticatedAccessUsingKernel 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::testAuthenticatedAccessUsingKernel()

Tests even listener based access control.

File

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

Class

EntityAccessCheckTest
Class EntityAccessCheckTest

Namespace

Drupal\Tests\permissions_by_entity\Kernel

Code

public function testAuthenticatedAccessUsingKernel() {
  $dispatcher = $this
    ->getPopulatedDispatcher();
  $this->container
    ->get('current_user')
    ->setAccount($this->terms['term_user_a']['user']);
  $dispatcher
    ->dispatch(KernelEvents::REQUEST, $this
    ->getRequestResponseEvent());
}