diff options
-rw-r--r-- | tests/template/template_test.php | 18 | ||||
-rw-r--r-- | tests/template/templates/loop_expressions.html | 4 | ||||
-rw-r--r-- | tests/template/templates/loop_expressions_twig.html | 4 | ||||
-rw-r--r-- | tests/template/templates/loop_expressions_twig2.html | 11 |
4 files changed, 27 insertions, 10 deletions
diff --git a/tests/template/template_test.php b/tests/template/template_test.php index b67b49bd35..33dc4ca551 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -491,21 +491,27 @@ class phpbb_template_template_test extends phpbb_template_template_test_case array(), 'inner_value', ), - // Disable: needs Twig 1.14.2 - /*array( + array( 'loop_expressions.html', - array('loop' => array(array(),array(),array(),array(),array(),array()),), array(), + array('loop' => array(array(),array(),array(),array(),array(),array()),), array(), - 'yesnonoyesnonoyesnoyesnonoyes', + 'yesnononoyesnoyesnonoyesnono', ), array( 'loop_expressions_twig.html', + array(), + array('loop' => array(array(),array(),array(),array(),array(),array()),), + array(), + 'yesnononoyesnoyesnonoyesnono', + ), + array( + 'loop_expressions_twig2.html', array('loop' => array(array(),array(),array(),array(),array(),array()),), array(), array(), - 'yesnonoyesnonoyesnoyesnonoyes', - ),*/ + 'yesnononoyesnoyesnonoyesnono', + ), ); } diff --git a/tests/template/templates/loop_expressions.html b/tests/template/templates/loop_expressions.html index 278bce1eca..ddb9fd52fa 100644 --- a/tests/template/templates/loop_expressions.html +++ b/tests/template/templates/loop_expressions.html @@ -1,11 +1,11 @@ <!-- BEGIN loop --> -<!-- IF loop.S_ROW_NUM is divisible by 4 -->on<!-- ELSE -->off<!-- ENDIF --> +<!-- IF loop.S_ROW_NUM is divisible by(4) -->yes<!-- ELSE -->no<!-- ENDIF --> <!-- END loop --> <!-- BEGIN loop --> -<!-- IF loop.S_ROW_NUM is divisible by 3 -->on<!-- ELSE -->off<!-- ENDIF --> +<!-- IF loop.S_ROW_NUM is divisible by(3) -->yes<!-- ELSE -->no<!-- ENDIF --> <!-- END loop --> diff --git a/tests/template/templates/loop_expressions_twig.html b/tests/template/templates/loop_expressions_twig.html index 61a36c51e4..5ca8cc3601 100644 --- a/tests/template/templates/loop_expressions_twig.html +++ b/tests/template/templates/loop_expressions_twig.html @@ -1,11 +1,11 @@ {% for loop_inner in loop %} -{% if loop_inner.S_ROW_NUM is divisible by 4 %}on{% else %}off{% endif %} +{% if loop_inner.S_ROW_NUM is divisible by(4) %}yes{% else %}no{% endif %} {% endfor %} {% for loop_inner in loop %} -{% if loop_inner.S_ROW_NUM is divisible by 3 %}on{% else %}off{% endif %} +{% if loop_inner.S_ROW_NUM is divisible by(3) %}yes{% else %}no{% endif %} {% endfor %} diff --git a/tests/template/templates/loop_expressions_twig2.html b/tests/template/templates/loop_expressions_twig2.html new file mode 100644 index 0000000000..16159ead4c --- /dev/null +++ b/tests/template/templates/loop_expressions_twig2.html @@ -0,0 +1,11 @@ +{% for loop_inner in loop %} + +{% if loop.index0 is divisible by(4) %}yes{% else %}no{% endif %} + +{% endfor %} + +{% for loop_inner in loop %} + +{% if loop.index0 is divisible by(3) %}yes{% else %}no{% endif %} + +{% endfor %} |