You are here

public function BlockInterestCohortTest::testSubrequestBlocking in Drupal 9

Same name and namespace in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Http/BlockInterestCohortTest.php \Drupal\KernelTests\Core\Http\BlockInterestCohortTest::testSubrequestBlocking()

Tests that FLoC blocking is ignored for subrequests.

File

core/tests/Drupal/KernelTests/Core/Http/BlockInterestCohortTest.php, line 62

Class

BlockInterestCohortTest
Tests the Permissions-Policy header added by FinishResponseSubscriber.

Namespace

Drupal\KernelTests\Core\Http

Code

public function testSubrequestBlocking() {
  $request = Request::create('/');
  $response = \Drupal::service('http_kernel')
    ->handle($request, HttpKernelInterface::SUB_REQUEST);
  $this
    ->assertFalse($response->headers
    ->has('Permissions-Policy'));
}