DisableFlocTest.php in Analytics 8
File
tests/src/Functional/DisableFlocTest.php
View source
<?php
namespace Drupal\Tests\analytics\Functional;
use Drupal\Tests\BrowserTestBase;
class DisableFlocTest extends BrowserTestBase {
protected static $modules = [
'user',
'analytics',
];
protected $defaultTheme = 'stark';
public function testDisableFloc() {
$this
->drupalGet('<front>');
$this
->assertSession()
->responseHeaderEquals('Permissions-Policy', NULL);
$account = $this
->createUser([
'administer analytics',
]);
$this
->drupalLogin($account);
$this
->drupalPostForm('admin/config/services/analytics/settings', [
'privacy[disable_floc]' => TRUE,
], 'Save configuration');
$this
->drupalLogout();
$this
->drupalGet('<front>');
$this
->assertSession()
->responseHeaderEquals('Permissions-Policy', 'interest-cohort=()');
}
}