@@ -39,6 +39,7 @@ public function testConstructor()
3939
4040 $ this ->assertEquals ($ form , $ node ->getNode ('form ' ));
4141 $ this ->assertEquals ($ resources , $ node ->getNode ('resources ' ));
42+ $ this ->assertFalse ($ node ->getAttribute ('only ' ));
4243 }
4344
4445 public function testCompile ()
@@ -60,7 +61,17 @@ public function testCompile()
6061
6162 $ this ->assertEquals (
6263 sprintf (
63- '$this->env->getRuntime("Symfony \\\\Component \\\\Form \\\\FormRenderer")->setTheme(%s, array(0 => "tpl1", 1 => "tpl2")); ' ,
64+ '$this->env->getRuntime("Symfony \\\\Component \\\\Form \\\\FormRenderer")->setTheme(%s, array(0 => "tpl1", 1 => "tpl2"), true); ' ,
65+ $ this ->getVariableGetter ('form ' )
66+ ),
67+ trim ($ compiler ->compile ($ node )->getSource ())
68+ );
69+
70+ $ node = new FormThemeNode ($ form , $ resources , 0 , null , true );
71+
72+ $ this ->assertEquals (
73+ sprintf (
74+ '$this->env->getRuntime("Symfony \\\\Component \\\\Form \\\\FormRenderer")->setTheme(%s, array(0 => "tpl1", 1 => "tpl2"), false); ' ,
6475 $ this ->getVariableGetter ('form ' )
6576 ),
6677 trim ($ compiler ->compile ($ node )->getSource ())
@@ -72,7 +83,17 @@ public function testCompile()
7283
7384 $ this ->assertEquals (
7485 sprintf (
75- '$this->env->getRuntime("Symfony \\\\Component \\\\Form \\\\FormRenderer")->setTheme(%s, "tpl1"); ' ,
86+ '$this->env->getRuntime("Symfony \\\\Component \\\\Form \\\\FormRenderer")->setTheme(%s, "tpl1", true); ' ,
87+ $ this ->getVariableGetter ('form ' )
88+ ),
89+ trim ($ compiler ->compile ($ node )->getSource ())
90+ );
91+
92+ $ node = new FormThemeNode ($ form , $ resources , 0 , null , true );
93+
94+ $ this ->assertEquals (
95+ sprintf (
96+ '$this->env->getRuntime("Symfony \\\\Component \\\\Form \\\\FormRenderer")->setTheme(%s, "tpl1", false); ' ,
7697 $ this ->getVariableGetter ('form ' )
7798 ),
7899 trim ($ compiler ->compile ($ node )->getSource ())
0 commit comments