From: Fabien Potencier Date: Thu, 1 Sep 2011 08:50:13 +0000 (+0200) Subject: added more unit tests X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=cbbeb71e851d1386c56cad32fda8cc8a6e4e2aa3;p=web%2Fkonrad%2Ftwig.git added more unit tests --- diff --git a/test/Twig/Tests/NodeVisitor/OptimizerTest.php b/test/Twig/Tests/NodeVisitor/OptimizerTest.php index 4a04f2f..d2d9b77 100644 --- a/test/Twig/Tests/NodeVisitor/OptimizerTest.php +++ b/test/Twig/Tests/NodeVisitor/OptimizerTest.php @@ -63,6 +63,10 @@ class Twig_Tests_NodeVisitor_OptimizerTest extends PHPUnit_Framework_TestCase array('{% for i in foo %}{% include "foo" only %}{% endfor %}', array('i' => false)), + array('{% for i in foo %}{% include "foo" with { "foo": "bar" } only %}{% endfor %}', array('i' => false)), + + array('{% for i in foo %}{% include "foo" with { "foo": loop.index } only %}{% endfor %}', array('i' => true)), + array('{% for i in foo %}{% for j in foo %}{{ loop.index }}{% endfor %}{% endfor %}', array('i' => false, 'j' => true)), array('{% for i in foo %}{% for j in foo %}{{ loop.parent.loop.index }}{% endfor %}{% endfor %}', array('i' => true, 'j' => true)),