mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-20 14:36:57 +00:00
added Twig_Environment::mergeGlobals()
This commit is contained in:
@@ -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
|
||||
@@ -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,
|
||||
));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user