aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test')
-rw-r--r--vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test
new file mode 100644
index 00000000..93bc76a1
--- /dev/null
+++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test
@@ -0,0 +1,19 @@
1--TEST--
2"for" tag adds a loop variable to the context
3--TEMPLATE--
4{% for item in items %}
5 * {{ loop.index }}/{{ loop.index0 }}
6 * {{ loop.revindex }}/{{ loop.revindex0 }}
7 * {{ loop.first }}/{{ loop.last }}/{{ loop.length }}
8
9{% endfor %}
10--DATA--
11return array('items' => array('a', 'b'))
12--EXPECT--
13 * 1/0
14 * 2/1
15 * 1//2
16
17 * 2/1
18 * 1/0
19 * /1/2