File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,6 @@ public function compile(\Twig_Compiler $compiler)
79
79
80
80
$ compiler
81
81
->outdent ()
82
- ->raw ("} \n" );
82
+ ->write ("} \n" );
83
83
}
84
84
}
Original file line number Diff line number Diff line change @@ -39,6 +39,30 @@ public function testNoVar()
39
39
$ this ->assertSame ($ expected , $ compiler ->compile ($ node )->getSource ());
40
40
}
41
41
42
+ public function testIndented ()
43
+ {
44
+ $ node = new DumpNode ('bar ' , null , 7 );
45
+
46
+ $ env = new \Twig_Environment ();
47
+ $ compiler = new \Twig_Compiler ($ env );
48
+
49
+ $ expected = <<<'EOTXT'
50
+ if ($this->env->isDebug()) {
51
+ $barvars = array();
52
+ foreach ($context as $barkey => $barval) {
53
+ if (!$barval instanceof \Twig_Template) {
54
+ $barvars[$barkey] = $barval;
55
+ }
56
+ }
57
+ // line 7
58
+ \Symfony\Component\VarDumper\VarDumper::dump($barvars);
59
+ }
60
+
61
+ EOTXT;
62
+
63
+ $ this ->assertSame ($ expected , $ compiler ->compile ($ node , 1 )->getSource ());
64
+ }
65
+
42
66
public function testOneVar ()
43
67
{
44
68
$ vars = new \Twig_Node (array (
You can’t perform that action at this time.
0 commit comments