You are here

public function BlockInterestCohortTest::testDisableBlockSetting in Drupal 10

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

Tests that FLoC blocking can be disabled in settings.php.

File

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

Class

BlockInterestCohortTest
Tests the Permissions-Policy header added by FinishResponseSubscriber.

Namespace

Drupal\KernelTests\Core\Http

Code

public function testDisableBlockSetting() {
  $settings = Settings::getAll();
  $settings['block_interest_cohort'] = FALSE;
  new Settings($settings);
  $request = Request::create('/');
  $response = \Drupal::service('http_kernel')
    ->handle($request);
  $this
    ->assertFalse($response->headers
    ->has('Permissions-Policy'));
}