32 {
33 $twig =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock());
34
35 $tests = array();
36
38 $extends = null;
43
45 $tests[] = array($node, <<<
EOF
47
48
50{
52 {
53 parent::__construct(\
$env);
54
55 \$this->parent = false;
56
57 \$this->blocks = array(
58 );
59 }
60
61 protected function doDisplay(array \$context, array \$blocks = array())
62 {
63
64 echo "foo";
65 }
66
67 public function getTemplateName()
68 {
69 return "foo.twig";
70 }
71
72 public function getDebugInfo()
73 {
74 return array ( 19 => 1,);
75 }
76
78 public function getSource()
79 {
80 @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
81
82 return \$this->getSourceContext()->getCode();
83 }
84
85 public function getSourceContext()
86 {
88 }
89}
91 , $twig, true);
92
94
97
99 $tests[] = array($node, <<<
EOF
101
102
104{
106 {
107 parent::__construct(\
$env);
108
109
110 \$this->parent = \$this->loadTemplate("layout.twig", "foo.twig", 1);
111 \$this->blocks = array(
112 );
113 }
114
115 protected function doGetParent(array \$context)
116 {
117 return "layout.twig";
118 }
119
120 protected function doDisplay(array \$context, array \$blocks = array())
121 {
122
123 \$context["macro"] = \$this->loadTemplate("foo.twig", "foo.twig", 2);
124
125 \$this->parent->display(\$context, array_merge(\$this->blocks, \$blocks));
126 }
127
128 public function getTemplateName()
129 {
130 return "foo.twig";
131 }
132
133 public function isTraitable()
134 {
135 return false;
136 }
137
138 public function getDebugInfo()
139 {
140 return array ( 26 => 1, 24 => 2, 11 => 1,);
141 }
142
144 public function getSource()
145 {
146 @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
147
148 return \$this->getSourceContext()->getCode();
149 }
150
151 public function getSourceContext()
152 {
154 }
155}
157 , $twig, true);
158
165 2
166 );
167
168 $twig =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(), array(
'debug' =>
true));
170 $tests[] = array($node, <<<
EOF
172
173
175{
176 protected function doGetParent(array \$context)
177 {
178
179 return \$this->
loadTemplate(((
true) ? (
"foo") : (
"foo")),
"foo.twig", 2);
180 }
181
182 protected function doDisplay(array \$context, array \$blocks = array())
183 {
184
185 \$context["foo"] = "foo";
186
187 \$this->getParent(\$context)->display(\$context, array_merge(\$this->blocks, \$blocks));
188 }
189
190 public function getTemplateName()
191 {
192 return "foo.twig";
193 }
194
195 public function isTraitable()
196 {
197 return false;
198 }
199
200 public function getDebugInfo()
201 {
202 return array ( 17 => 2, 15 => 4, 9 => 2,);
203 }
204
206 public function getSource()
207 {
208 @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
209
210 return \$this->getSourceContext()->getCode();
211 }
212
213 public function getSourceContext()
214 {
215 return new Twig_Source(
"{{ foo }}",
"foo.twig",
"");
216 }
217}
219 , $twig, true);
220
221 return $tests;
222 }
const EOF
How fgetc() reports an End Of File.
An exception for terminatinating execution or to throw for unit testing.
Stores the Twig configuration.
Represents an import node.
Represents a module node.
Represents a node in the AST.
Holds information about a non-compiled Twig template.
Default base class for compiled templates.
loadTemplate($template, $templateName=null, $line=null, $index=null)