File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929use Config \Logger ;
3030use Config \Modules ;
3131use InvalidArgumentException ;
32+ use Kint ;
3233use stdClass ;
3334use Tests \Support \Models \JobModel ;
3435
@@ -482,4 +483,37 @@ public function testIsCli()
482483 $ this ->assertIsBool (is_cli ());
483484 $ this ->assertTrue (is_cli ());
484485 }
486+
487+ public function testDWithCSP ()
488+ {
489+ /** @var App $config */
490+ $ config = config (App::class);
491+ $ CSPEnabled = $ config ->CSPEnabled ;
492+ $ cliDetection = Kint::$ cli_detection ;
493+
494+ $ config ->CSPEnabled = true ;
495+ Kint::$ cli_detection = false ;
496+
497+ $ this ->expectOutputRegex ('/<script {csp-script-nonce} class="kint-rich-script">/u ' );
498+ d ('string ' );
499+
500+ // Restore settings
501+ $ config ->CSPEnabled = $ CSPEnabled ;
502+ Kint::$ cli_detection = $ cliDetection ;
503+ }
504+
505+ /**
506+ * @runInSeparateProcess
507+ * @preserveGlobalState disabled
508+ */
509+ public function testTraceWithCSP ()
510+ {
511+ /** @var App $config */
512+ $ config = config (App::class);
513+ $ config ->CSPEnabled = true ;
514+ Kint::$ cli_detection = false ;
515+
516+ $ this ->expectOutputRegex ('/<style {csp-style-nonce} class="kint-rich-style">/u ' );
517+ trace ();
518+ }
485519}
You can’t perform that action at this time.
0 commit comments