Upgrade problem

This commit is contained in:
dantleech
2012-12-31 14:04:50 +00:00
committed by Fabien Potencier
parent 25f7b0c7eb
commit 9f5fa532ef
2 changed files with 18 additions and 2 deletions
+10
View File
@@ -107,6 +107,16 @@ class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase
} catch (LogicException $e) {
$this->assertFalse(array_key_exists('bar', $twig->getGlobals()));
}
// test adding globals after initRuntime without call to getGlobals
$twig = new Twig_Environment(new Twig_Loader_String());
$twig->initRuntime();
try {
$twig->addGlobal('bar', 'bar');
$this->fail();
} catch (LogicException $e) {
$this->assertFalse(array_key_exists('bar', $twig->getGlobals()));
}
}
public function testExtensionsAreNotInitializedWhenRenderingACompiledTemplate()