File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -302,6 +302,21 @@ public function testScriptSrc(): void
302
302
$ this ->assertStringContainsString ("script-src 'self' cdn.cloudy.com; " , (string ) $ result );
303
303
}
304
304
305
+ #[PreserveGlobalState(false )]
306
+ #[RunInSeparateProcess]
307
+ public function testScriptSrcElem (): void
308
+ {
309
+ $ this ->prepare ();
310
+ $ this ->csp ->addScriptSrcElem ('cdn.cloudy.com ' );
311
+ $ this ->csp ->addScriptSrcElem ('them.com ' , true );
312
+ $ result = $ this ->work ();
313
+
314
+ $ result = $ this ->getHeaderEmitted ('Content-Security-Policy-Report-Only ' );
315
+ $ this ->assertStringContainsString ('script-src-elem them.com; ' , (string ) $ result );
316
+ $ result = $ this ->getHeaderEmitted ('Content-Security-Policy ' );
317
+ $ this ->assertStringContainsString ("script-src-elem 'self' cdn.cloudy.com; " , (string ) $ result );
318
+ }
319
+
305
320
#[PreserveGlobalState(false )]
306
321
#[RunInSeparateProcess]
307
322
public function testStyleSrc (): void
You can’t perform that action at this time.
0 commit comments