File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 29
29
use Config \Logger ;
30
30
use Config \Modules ;
31
31
use InvalidArgumentException ;
32
+ use Kint ;
32
33
use stdClass ;
33
34
use Tests \Support \Models \JobModel ;
34
35
@@ -482,4 +483,37 @@ public function testIsCli()
482
483
$ this ->assertIsBool (is_cli ());
483
484
$ this ->assertTrue (is_cli ());
484
485
}
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
+ }
485
519
}
You can’t perform that action at this time.
0 commit comments