File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 8
8
9
9
class JavascriptRendererTest extends DebugBarTestCase
10
10
{
11
+ /** @var JavascriptRenderer */
12
+ protected $ r ;
13
+
11
14
public function setUp (): void
12
15
{
13
16
parent ::setUp ();
@@ -137,6 +140,13 @@ public function testRenderConstructorOnly()
137
140
$ this ->assertStringStartsWith ("<script type= \"text/javascript \"> \nvar foovar = new Foobar(); \nfoovar.addDataSet( " , $ this ->r ->render ());
138
141
}
139
142
143
+ public function testRenderConstructorWithNonce ()
144
+ {
145
+ $ this ->r ->setInitialization (JavascriptRenderer::INITIALIZE_CONSTRUCTOR );
146
+ $ this ->r ->setCspNonce ('mynonce ' );
147
+ $ this ->assertStringStartsWith ("<script type= \"text/javascript \" nonce= \"mynonce \"> \nvar phpdebugbar = new PhpDebugBar.DebugBar(); " , $ this ->r ->render ());
148
+ }
149
+
140
150
public function testJQueryNoConflictAutoDisabling ()
141
151
{
142
152
$ this ->assertTrue ($ this ->r ->isJqueryNoConflictEnabled ());
You can’t perform that action at this time.
0 commit comments