projects
/
web/konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
c6445fb
)
Added unit test for bug when calling getGlobals() before addGlobal() on Twig_Environment.
author
Jesper Ek
<deadbeef84@gmail.com>
Thu, 7 Feb 2013 23:08:43 +0000 (
00:08
+0100)
committer
Jesper Ek
<deadbeef84@gmail.com>
Thu, 7 Feb 2013 23:08:43 +0000 (
00:08
+0100)
test/Twig/Tests/EnvironmentTest.php
patch
|
blob
|
history
diff --git
a/test/Twig/Tests/EnvironmentTest.php
b/test/Twig/Tests/EnvironmentTest.php
index
d71e2ec
..
664e980
100644
(file)
--- a/
test/Twig/Tests/EnvironmentTest.php
+++ b/
test/Twig/Tests/EnvironmentTest.php
@@
-81,6
+81,12
@@
class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase
$globals = $twig->getGlobals();
$this->assertEquals('bar', $globals['foo']);
+ $twig = new Twig_Environment(new Twig_Loader_String());
+ $twig->getGlobals();
+ $twig->addGlobal('foo', 'bar');
+ $template = $twig->loadTemplate('{{foo}}');
+ $this->assertEquals('bar', $template->render(array()));
+
/* to be uncomment in Twig 2.0
// globals cannot be added after runtime init
$twig = new Twig_Environment(new Twig_Loader_String());