You are here

private function EntityAccessCheckTest::getPopulatedDispatcher in Permissions by Term 8.2

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

Gets a populated dispatcher.

Return value

\Symfony\Component\EventDispatcher\EventDispatcher

3 calls to EntityAccessCheckTest::getPopulatedDispatcher()
EntityAccessCheckTest::testAnonymousAccessDeniedUsingKernel in modules/permissions_by_entity/tests/src/Kernel/EntityAccessCheckTest.php
Tests even listener based access control.
EntityAccessCheckTest::testAuthenticatedAccessUsingKernel in modules/permissions_by_entity/tests/src/Kernel/EntityAccessCheckTest.php
Tests even listener based access control.
EntityAccessCheckTest::testAuthenticatedDeniedOnCachedAccessUsingKernel in modules/permissions_by_entity/tests/src/Kernel/EntityAccessCheckTest.php
Tests even listener based access control.

File

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

Class

EntityAccessCheckTest
Class EntityAccessCheckTest

Namespace

Drupal\Tests\permissions_by_entity\Kernel

Code

private function getPopulatedDispatcher() {
  $dispatcher = new EventDispatcher();
  $cache_subscriber = $this->container
    ->get('mocked_dynamic_page_cache_subscriber');
  $access_subscriber = $this->container
    ->get('permissions_by_entity.kernel_event_subscriber');
  $dispatcher
    ->addSubscriber($cache_subscriber);
  $dispatcher
    ->addSubscriber($access_subscriber);
  return $dispatcher;
}