From: Fabien Potencier Date: Wed, 23 Nov 2011 13:24:45 +0000 (+0100) Subject: fixed unit tests due to a difference between the PHP and C versions of Twig_Template... X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=317f6e47256f3e19d2f25fb9f398f2120505890e;p=konrad%2Ftwig.git fixed unit tests due to a difference between the PHP and C versions of Twig_Template::getAttribute() --- 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()