added Twig_Environment::mergeGlobals()

This commit is contained in:
Fabien Potencier
2012-04-03 19:13:43 +02:00
parent 3398b38cf0
commit f2f1f32b41
6 changed files with 38 additions and 16 deletions
@@ -0,0 +1,14 @@
--TEST--
"macro" tag
--TEMPLATE--
{% from 'forms.twig' import foo %}
{{ foo('foo') }}
{{ foo() }}
--TEMPLATE(forms.twig)--
{% macro foo(name) %}{{ name|default('foo') }}{{ global }}{% endmacro %}
--DATA--
return array()
--EXPECT--
fooglobal
fooglobal
+1 -1
View File
@@ -46,7 +46,7 @@ class Twig_Tests_Node_MacroTest extends Twig_Tests_Node_TestCase
array($node, <<<EOF
public function getfoo(\$foo = null)
{
\$context = \$this->mergeContextWithGlobals(array(
\$context = \$this->env->mergeGlobals(array(
"foo" => \$foo,
));