public function getTestsForForOptimizer() {
return array(
array(
'{% for i in foo %}{% endfor %}',
array(
'i' => false,
),
),
array(
'{% for i in foo %}{{ loop.index }}{% endfor %}',
array(
'i' => true,
),
),
array(
'{% for i in foo %}{% for j in foo %}{% endfor %}{% endfor %}',
array(
'i' => false,
'j' => false,
),
),
array(
'{% for i in foo %}{% include "foo" %}{% endfor %}',
array(
'i' => true,
),
),
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,
),
),
array(
'{% for i in foo %}{% set l = loop %}{% for j in foo %}{{ l.index }}{% endfor %}{% endfor %}',
array(
'i' => true,
'j' => false,
),
),
array(
'{% for i in foo %}{% for j in foo %}{{ foo.parent.loop.index }}{% endfor %}{% endfor %}',
array(
'i' => false,
'j' => false,
),
),
array(
'{% for i in foo %}{% for j in foo %}{{ loop["parent"].loop.index }}{% endfor %}{% endfor %}',
array(
'i' => true,
'j' => true,
),
),
);
}