Skip to content

Commit 85e52db

Browse files
committed
test: add test to remove report-uri
1 parent fe8dcd6 commit 85e52db

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/system/HTTP/ContentSecurityPolicyTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,19 @@ public function testReportURI(): void
379379
$this->assertStringContainsString('report-uri http://example.com/csptracker;', $result);
380380
}
381381

382+
#[PreserveGlobalState(false)]
383+
#[RunInSeparateProcess]
384+
public function testRemoveReportURI(): void
385+
{
386+
$this->prepare();
387+
$this->csp->reportOnly(false);
388+
$this->csp->setReportURI('');
389+
$this->work();
390+
391+
$result = $this->getHeaderEmitted('Content-Security-Policy');
392+
$this->assertStringNotContainsString('report-uri ', $result);
393+
}
394+
382395
#[PreserveGlobalState(false)]
383396
#[RunInSeparateProcess]
384397
public function testSandboxFlags(): void

0 commit comments

Comments
 (0)