You are here

private function EntityAccessCheckTest::getCachableResponseEvent 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::getCachableResponseEvent()

Gets a cachable filter response for term a.

Return value

\Symfony\Component\HttpKernel\Event\FilterResponseEvent

1 call to EntityAccessCheckTest::getCachableResponseEvent()
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 237

Class

EntityAccessCheckTest
Class EntityAccessCheckTest

Namespace

Drupal\Tests\permissions_by_entity\Kernel

Code

private function getCachableResponseEvent() {
  $response = new CacheableResponse();
  $kernel = $this
    ->getMock(HttpKernelInterface::class);
  $request = new Request();
  $request->attributes
    ->set('_entity', $this->nodes['test_entity_term_a']);
  return new FilterResponseEvent($kernel, $request, HttpKernelInterface::SUB_REQUEST, $response);
}