From 317f6e47256f3e19d2f25fb9f398f2120505890e Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 23 Nov 2011 14:24:45 +0100 Subject: [PATCH] fixed unit tests due to a difference between the PHP and C versions of Twig_Template::getAttribute() --- lib/Twig/Template.php | 8 ++++++++ test/Twig/Tests/TemplateTest.php | 1 + 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/lib/Twig/Template.php b/lib/Twig/Template.php index 6fde24e..0e20512 100644 --- a/lib/Twig/Template.php +++ b/lib/Twig/Template.php @@ -417,4 +417,12 @@ abstract class Twig_Template implements Twig_TemplateInterface return $ret; } + + /** + * This method is only useful when testing Twig. Do not use it. + */ + static public function clearCache() + { + self::$cache = array(); + } } diff --git a/test/Twig/Tests/TemplateTest.php b/test/Twig/Tests/TemplateTest.php index c5caec1..4918de7 100644 --- a/test/Twig/Tests/TemplateTest.php +++ b/test/Twig/Tests/TemplateTest.php @@ -192,6 +192,7 @@ class Twig_TemplateTest extends Twig_Template { parent::__construct($env); $this->useExtGetAttribute = $useExtGetAttribute; + Twig_Template::clearCache(); } public function getTemplateName() -- 1.7.2.5