24 $this->assertEquals($body, $node->getNode(
'body'));
25 $this->assertEquals($blocks, $node->getNode(
'blocks'));
26 $this->assertEquals($macros, $node->getNode(
'macros'));
27 $this->assertEquals($parent, $node->getNode(
'parent'));
28 $this->assertEquals(
$source->getName(), $node->getTemplateName());
33 $twig =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock());
53 parent::__construct(\$env);
55 \$this->parent =
false;
57 \$this->blocks =
array(
67 public function getTemplateName()
72 public function getDebugInfo()
74 return array ( 19 => 1,);
78 public function getSource()
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);
82 return \$this->getSourceContext()->getCode();
85 public function getSourceContext()
107 parent::__construct(\$env);
110 \$this->parent = \$this->loadTemplate(
"layout.twig",
"foo.twig", 1);
111 \$this->blocks =
array(
115 protected function doGetParent(
array \$context)
117 return "layout.twig";
120 protected function doDisplay(
array \$context,
array \$blocks =
array())
123 \$context[
"macro"] = \$this->loadTemplate(
"foo.twig",
"foo.twig", 2);
125 \$this->parent->display(\$context, array_merge(\$this->blocks, \$blocks));
128 public function getTemplateName()
133 public function isTraitable()
138 public function getDebugInfo()
140 return array ( 26 => 1, 24 => 2, 11 => 1,);
144 public function getSource()
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);
148 return \$this->getSourceContext()->getCode();
151 public function getSourceContext()
168 $twig =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'debug' =>
true));
176 protected function doGetParent(
array \$context)
179 return \$this->
loadTemplate(((
true) ? (
"foo") : (
"foo")),
"foo.twig", 2);
182 protected function doDisplay(
array \$context,
array \$blocks =
array())
185 \$context[
"foo"] =
"foo";
187 \$this->getParent(\$context)->display(\$context, array_merge(\$this->blocks, \$blocks));
190 public function getTemplateName()
195 public function isTraitable()
200 public function getDebugInfo()
202 return array ( 17 => 2, 15 => 4, 9 => 2,);
206 public function getSource()
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);
210 return \$this->getSourceContext()->getCode();
213 public function getSourceContext()
215 return new Twig_Source(
"{{ foo }}",
"foo.twig",
"");
loadTemplate($template, $templateName=null, $line=null, $index=null)
Represents a node in the AST.
Represents a module node.
Create styles array
The data for the language used.
Default base class for compiled templates.
Represents an import node.
Holds information about a non-compiled Twig template.
Stores the Twig configuration.
const EOF
How fgetc() reports an End Of File.