[ticket/13132] Enable twig expressions tests

PHPBB3-13132
This commit is contained in:
Nicofuma 2015-03-05 21:53:48 +01:00
parent cf39cfc593
commit 54753e926d
4 changed files with 27 additions and 10 deletions

View file

@ -491,21 +491,27 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(), array(),
'inner_value', 'inner_value',
), ),
// Disable: needs Twig 1.14.2 array(
/*array(
'loop_expressions.html', 'loop_expressions.html',
array(),
array('loop' => array(array(),array(),array(),array(),array(),array()),), array('loop' => array(array(),array(),array(),array(),array(),array()),),
array(), array(),
array(), 'yesnononoyesnoyesnonoyesnono',
'yesnonoyesnonoyesnoyesnonoyes',
), ),
array( array(
'loop_expressions_twig.html', '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('loop' => array(array(),array(),array(),array(),array(),array()),),
array(), array(),
array(), array(),
'yesnonoyesnonoyesnoyesnonoyes', 'yesnononoyesnoyesnonoyesnono',
),*/ ),
); );
} }

View file

@ -1,11 +1,11 @@
<!-- BEGIN loop --> <!-- 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 --> <!-- END loop -->
<!-- BEGIN 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 --> <!-- END loop -->

View file

@ -1,11 +1,11 @@
{% for loop_inner in loop %} {% 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 %} {% endfor %}
{% for loop_inner in loop %} {% 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 %} {% endfor %}

View file

@ -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 %}