diff options
Diffstat (limited to 'tests/template/templates')
51 files changed, 315 insertions, 77 deletions
diff --git a/tests/template/templates/basic.html b/tests/template/templates/basic.html index c1dd690260..e5c6f280fb 100644 --- a/tests/template/templates/basic.html +++ b/tests/template/templates/basic.html @@ -16,5 +16,8 @@ fail <!-- BEGINELSE --> pass <!-- END empty --> +<!-- IF not S_EMPTY --> +pass +<!-- ENDIF --> <!-- DUMMY var --> diff --git a/tests/template/templates/child_only.css b/tests/template/templates/child_only.css new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/template/templates/child_only.css diff --git a/tests/template/templates/child_only.html b/tests/template/templates/child_only.html new file mode 100644 index 0000000000..6121fef5c5 --- /dev/null +++ b/tests/template/templates/child_only.html @@ -0,0 +1 @@ +Only in child. diff --git a/tests/template/templates/child_only.js b/tests/template/templates/child_only.js new file mode 100644 index 0000000000..542b26526c --- /dev/null +++ b/tests/template/templates/child_only.js @@ -0,0 +1 @@ +// JavaScript file only in a child style. diff --git a/tests/template/templates/define.html b/tests/template/templates/define.html index 82237d21a3..276d2ebb99 100644 --- a/tests/template/templates/define.html +++ b/tests/template/templates/define.html @@ -2,7 +2,36 @@ {$VALUE} <!-- DEFINE $VALUE = 'abc' --> {$VALUE} +<!-- IF $VALUE != 'abc' --> +$VALUE != 'abc' +<!-- ELSEIF $VALUE == 'abc' --> +$VALUE == 'abc' +<!-- ENDIF --> +<!-- IF ($VALUE == 'abc') --> +($VALUE == 'abc') +<!-- ENDIF --> +<!-- IF (($VALUE == 'abc')) --> +(($VALUE == 'abc')) +<!-- ENDIF --> +<!-- IF !$DOESNT_EXIST --> +!$DOESNT_EXIST +<!-- ENDIF --> +<!-- IF (!$DOESNT_EXIST) --> +(!$DOESNT_EXIST) +<!-- ENDIF --> +<!-- INCLUDE define_include.html --> +{$INCLUDED_VALUE} +{$VALUE} <!-- UNDEFINE $VALUE --> {$VALUE} -<!-- DEFINE $VALUE --> - +<!-- DEFINE $VALUE = 'test!@#$%^&*()_-=+{}[]:;",<.>/?' --> +{$VALUE} +<!-- DEFINE $VALUE = '' --> +[{$VALUE}] +<!-- DEFINE $TEST -->foobar<!-- ENDDEFINE -->|{$TEST}| +<!-- DEFINE $VAR = false --> +<!-- IF $VAR --> +true +<!-- ELSE --> +false +<!-- ENDIF --> diff --git a/tests/template/templates/define_advanced.html b/tests/template/templates/define_advanced.html new file mode 100644 index 0000000000..83467a5b4b --- /dev/null +++ b/tests/template/templates/define_advanced.html @@ -0,0 +1,12 @@ +<!-- DEFINE $VALUE --> +abc +<!-- ENDDEFINE --> +{$VALUE} +<!-- DEFINE $VALUE1 --> +bcd +<!-- ENDDEFINE --> +<!-- DEFINE $VALUE2 --> +cde +<!-- ENDDEFINE --> +<!-- INCLUDE define_include2.html --> +{$INCLUDED_VALUE3} diff --git a/tests/template/templates/define_error.html b/tests/template/templates/define_error.html new file mode 100644 index 0000000000..72ab1ba033 --- /dev/null +++ b/tests/template/templates/define_error.html @@ -0,0 +1,2 @@ +<!-- DEFINE $VAR = foo --> +{$VAR} diff --git a/tests/template/templates/define_include.html b/tests/template/templates/define_include.html new file mode 100644 index 0000000000..9c470c296a --- /dev/null +++ b/tests/template/templates/define_include.html @@ -0,0 +1,3 @@ +{$VALUE} +<!-- DEFINE $INCLUDED_VALUE = 'bar' --> +{$INCLUDED_VALUE} diff --git a/tests/template/templates/define_include2.html b/tests/template/templates/define_include2.html new file mode 100644 index 0000000000..874f3e1852 --- /dev/null +++ b/tests/template/templates/define_include2.html @@ -0,0 +1,11 @@ +<!-- DEFINE $INCLUDED_VALUE1 --> +zxc +<!-- ENDDEFINE --> +<!-- DEFINE $INCLUDED_VALUE2 --> +qwe +<!-- ENDDEFINE --> +{$INCLUDED_VALUE1} +<!-- DEFINE $INCLUDED_VALUE3 --> +{$VALUE2} +{$VALUE1} +<!-- ENDDEFINE --> diff --git a/tests/template/templates/events.html b/tests/template/templates/events.html new file mode 100644 index 0000000000..c44a7469e7 --- /dev/null +++ b/tests/template/templates/events.html @@ -0,0 +1,4 @@ +<!-- EVENT child_only --> +<!-- EVENT parent_only --> +<!-- EVENT parent_and_child --> +<!-- EVENT random_event --> diff --git a/tests/template/templates/expressions.html b/tests/template/templates/expressions.html index c40d967dab..e1283f165f 100644 --- a/tests/template/templates/expressions.html +++ b/tests/template/templates/expressions.html @@ -1,86 +1,57 @@ <!-- IF 10 is even -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 9 is even -->fail<!-- ELSE -->pass<!-- ENDIF --> - <!-- IF not 390 is even -->fail<!-- ELSE -->pass<!-- ENDIF --> - <!-- IF 9 is odd -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 32 is odd -->fail<!-- ELSE -->pass<!-- ENDIF --> - <!-- IF 32 is div by 16 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 10 is not even -->fail<!-- ELSE -->pass<!-- ENDIF --> - <!-- IF 24 == 24 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 24 eq 24 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF ((((((24 == 24)))))) -->pass<!-- ELSE -->fail<!-- ENDIF --> <!-- IF 24 != 20 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 24 <> 20 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 24 ne 20 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 24 neq 20 -->pass<!-- ELSE -->fail<!-- ENDIF --> <!-- IF 10 lt 20 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 10 < 20 -->pass<!-- ELSE -->fail<!-- ENDIF --> <!-- IF 10 le 20 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 10 lte 20 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 10 <= 20 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 20 le 20 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 20 lte 20 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 20 <= 20 -->pass<!-- ELSE -->fail<!-- ENDIF --> <!-- IF 9 gt 1 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 9 > 1 -->pass<!-- ELSE -->fail<!-- ENDIF --> <!-- IF 9 >= 1 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 9 gte 1 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 9 ge 1 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 9 >= 9 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 9 gte 9 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 9 ge 9 -->pass<!-- ELSE -->fail<!-- ENDIF --> <!-- IF true && (10 > 4) -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF true and (10 > 4) -->pass<!-- ELSE -->fail<!-- ENDIF --> <!-- IF false || true -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF false or true -->pass<!-- ELSE -->fail<!-- ENDIF --> <!-- IF !false -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF not false -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF not not not false -->pass<!-- ELSE -->fail<!-- ENDIF --> <!-- IF 6 % 4 == 2 -->pass<!-- ELSE -->fail<!-- ENDIF --> - <!-- IF 24 mod 12 == 0 -->pass<!-- ELSE -->fail<!-- ENDIF --> diff --git a/tests/template/templates/if.html b/tests/template/templates/if.html index c502e52f51..71312f994c 100644 --- a/tests/template/templates/if.html +++ b/tests/template/templates/if.html @@ -2,10 +2,24 @@ 1 <!-- ELSEIF S_OTHER_VALUE --> 2 +<!-- ELSE IF S_OTHER_OTHER_VALUE --> +|S_OTHER_OTHER_VALUE| <!-- ELSE --> -0 +03 <!-- ENDIF --> -<!-- IF (S_VALUE > S_OTHER_VALUE) --> -0 +<!-- IF S_VALUE and S_OTHER_VALUE and (S_VALUE > S_OTHER_VALUE) --> +04 +<!-- ENDIF --> + +<!-- IF S_TEST === false --> +false +<!-- ENDIF --> + +<!-- IF S_TEST !== false --> +!false +<!-- ENDIF --> + +<!-- IF VALUE_TEST is defined --> +{VALUE_TEST} <!-- ENDIF --> diff --git a/tests/template/templates/include_define_variable.html b/tests/template/templates/include_define_variable.html index aff9b574c2..6052657c97 100644 --- a/tests/template/templates/include_define_variable.html +++ b/tests/template/templates/include_define_variable.html @@ -1,2 +1,8 @@ <!-- DEFINE $DEF = '{VARIABLE}' --> <!-- INCLUDE {$DEF} --> + +<!-- DEFINE $DEF_WITH_UNDERSCORES = '{VARIABLE}' --> +<!-- INCLUDE {$DEF_WITH_UNDERSCORES} --> + +<!-- DEFINE $DEF123 = '{VARIABLE}' --> +<!-- INCLUDE {$DEF123} --> diff --git a/tests/template/templates/include_loop.html b/tests/template/templates/include_loop.html new file mode 100644 index 0000000000..5cad34b363 --- /dev/null +++ b/tests/template/templates/include_loop.html @@ -0,0 +1,4 @@ +<!-- BEGIN test_loop --> +<!-- INCLUDE {test_loop.NESTED_FILE} --> +<!-- BEGIN inner -->_<!-- INCLUDE {test_loop.inner.NESTED_FILE} --><!-- END inner --> +<!-- END test_loop --> diff --git a/tests/template/templates/include_loop1.html b/tests/template/templates/include_loop1.html new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/tests/template/templates/include_loop1.html @@ -0,0 +1 @@ +1 diff --git a/tests/template/templates/include_loop2.html b/tests/template/templates/include_loop2.html new file mode 100644 index 0000000000..9e22bcb8e3 --- /dev/null +++ b/tests/template/templates/include_loop2.html @@ -0,0 +1 @@ +02 diff --git a/tests/template/templates/include_loop3.html b/tests/template/templates/include_loop3.html new file mode 100644 index 0000000000..00750edc07 --- /dev/null +++ b/tests/template/templates/include_loop3.html @@ -0,0 +1 @@ +3 diff --git a/tests/template/templates/include_loop_define.html b/tests/template/templates/include_loop_define.html index f539b21396..4bab09422e 100644 --- a/tests/template/templates/include_loop_define.html +++ b/tests/template/templates/include_loop_define.html @@ -1,4 +1,4 @@ -<!-- BEGIN loop --> -<!-- DEFINE $DEF = '{loop.NESTED_FILE}' --> +<!-- BEGIN test_loop --> +<!-- DEFINE $DEF = '{test_loop.NESTED_FILE}' --> <!-- INCLUDE {$DEF} --> -<!-- END loop --> +<!-- END test_loop --> diff --git a/tests/template/templates/include_variable.html b/tests/template/templates/include_variable.html new file mode 100644 index 0000000000..b907e0b44f --- /dev/null +++ b/tests/template/templates/include_variable.html @@ -0,0 +1 @@ +<!-- INCLUDE {FILE} --> diff --git a/tests/template/templates/include_variables.html b/tests/template/templates/include_variables.html new file mode 100644 index 0000000000..8371a061b5 --- /dev/null +++ b/tests/template/templates/include_variables.html @@ -0,0 +1 @@ +<!-- INCLUDE {SUBDIR}/variable.html --> diff --git a/tests/template/templates/includecss.html b/tests/template/templates/includecss.html new file mode 100644 index 0000000000..a09e44f240 --- /dev/null +++ b/tests/template/templates/includecss.html @@ -0,0 +1,3 @@ +<!-- INCLUDECSS child_only.css --> +<!-- INCLUDECSS parent_only.css --> +{$STYLESHEETS} diff --git a/tests/template/templates/includejs.html b/tests/template/templates/includejs.html new file mode 100644 index 0000000000..0bcdf1a815 --- /dev/null +++ b/tests/template/templates/includejs.html @@ -0,0 +1,36 @@ +<!-- IF TEST === 1 --> + <!-- INCLUDEJS parent_and_child.js --> +<!-- ELSEIF TEST === 2 --> + <!-- INCLUDEJS parent_and_child.js?assets_version=0 --> +<!-- ELSEIF TEST === 3 --> + <!-- INCLUDEJS parent_and_child.js?test=1&assets_version=0 --> +<!-- ELSEIF TEST === 4 --> + <!-- INCLUDEJS parent_and_child.js?test=1&assets_version=0 --> +<!-- ELSEIF TEST === 6 --> + <!-- INCLUDEJS {PARENT} --> +<!-- ELSEIF TEST === 7 --> + <!-- DEFINE $TEST = 'child_only.js' --> + <!-- INCLUDEJS {$TEST} --> +<!-- ELSEIF TEST === 8 --> + <!-- INCLUDEJS subdir/{PARENT} --> +<!-- ELSEIF TEST === 9 --> + <!-- INCLUDEJS {SUBDIR}/subsubdir/{PARENT} --> +<!-- ELSEIF TEST === 10 --> + <!-- INCLUDEJS {SUBDIR}/parent_only.{EXT} --> +<!-- ELSEIF TEST === 11 --> + <!-- DEFINE $TEST = 'child_only.js?test1=1&test2=2#test3' --> + <!-- INCLUDEJS {$TEST} --> +<!-- ELSEIF TEST === 12 --> + <!-- INCLUDEJS parent_only.js?test1=1&test2=2#test3 --> +<!-- ELSEIF TEST === 14 --> + <!-- INCLUDEJS parent_only.js?test1="#test3 --> +<!-- ELSEIF TEST === 15 --> + <!-- INCLUDEJS http://phpbb.com/b.js?c=d#f --> +<!-- ELSEIF TEST === 16 --> + <!-- INCLUDEJS http://phpbb.com/b.js?c=d&assets_version=2#f --> +<!-- ELSEIF TEST === 17 --> + <!-- INCLUDEJS //phpbb.com/b.js --> +<!-- ELSEIF TEST === 18 --> + <!-- INCLUDEJS parent_and_child.js?test=1&test2=0 --> +<!-- ENDIF --> +{$SCRIPTS} diff --git a/tests/template/templates/includephp.html b/tests/template/templates/includephp_relative.html index 70ebdac0d0..297c9efcb0 100644 --- a/tests/template/templates/includephp.html +++ b/tests/template/templates/includephp_relative.html @@ -1 +1,2 @@ +Path is relative to board root. <!-- INCLUDEPHP ../tests/template/templates/_dummy_include.php.inc --> diff --git a/tests/template/templates/includephp_variables.html b/tests/template/templates/includephp_variables.html new file mode 100644 index 0000000000..6106efc86a --- /dev/null +++ b/tests/template/templates/includephp_variables.html @@ -0,0 +1,2 @@ +Path includes variables. +<!-- INCLUDEPHP ../tests/template/{TEMPLATES}/_dummy_include.php.inc --> diff --git a/tests/template/templates/invalid/endif_without_if.html b/tests/template/templates/invalid/endif_without_if.html new file mode 100644 index 0000000000..e371ffd150 --- /dev/null +++ b/tests/template/templates/invalid/endif_without_if.html @@ -0,0 +1 @@ +<!-- ENDIF --> diff --git a/tests/template/templates/invalid/output/endif_without_if.html b/tests/template/templates/invalid/output/endif_without_if.html new file mode 100644 index 0000000000..5f2239c964 --- /dev/null +++ b/tests/template/templates/invalid/output/endif_without_if.html @@ -0,0 +1 @@ +Parse error (fatal, destroys php runtime). diff --git a/tests/template/templates/invalid/output/include_nonexistent_file.html b/tests/template/templates/invalid/output/include_nonexistent_file.html new file mode 100644 index 0000000000..8a118d2713 --- /dev/null +++ b/tests/template/templates/invalid/output/include_nonexistent_file.html @@ -0,0 +1 @@ +style resource locator: File for handle nonexistent.html does not exist. Could not find: diff --git a/tests/template/templates/invalid/output/unknown_tag.html b/tests/template/templates/invalid/output/unknown_tag.html new file mode 100644 index 0000000000..1489e5e31a --- /dev/null +++ b/tests/template/templates/invalid/output/unknown_tag.html @@ -0,0 +1 @@ +<!-- UNKNOWNTAG variable.html --> diff --git a/tests/template/templates/lang.html b/tests/template/templates/lang.html index 2b5ea1cafe..3eecc298cb 100644 --- a/tests/template/templates/lang.html +++ b/tests/template/templates/lang.html @@ -1,3 +1,5 @@ {L_VARIABLE} +{L_1_VARIABLE} {LA_VARIABLE} +{LA_1_VARIABLE} diff --git a/tests/template/templates/loop.html b/tests/template/templates/loop.html index de1a10004d..f541e934df 100644 --- a/tests/template/templates/loop.html +++ b/tests/template/templates/loop.html @@ -1,21 +1,21 @@ -<!-- BEGIN loop --> +<!-- BEGIN test_loop --> loop <!-- BEGINELSE --> noloop -<!-- END loop --> +<!-- END test_loop --> -<!-- IF .loop --> +<!-- IF .test_loop --> loop <!-- ELSE --> noloop <!-- ENDIF --> -<!-- IF .loop == 2 --> +<!-- IF .test_loop == 2 --> loop <!-- ENDIF --> -<!-- BEGIN loop --> +<!-- BEGIN test_loop --> <!-- BEGIN !block --> -loop#{loop.S_ROW_COUNT}-block#{block.S_ROW_COUNT} +loop#{test_loop.S_ROW_COUNT}-block#{block.S_ROW_COUNT} <!-- END !block --> -<!-- END loop --> +<!-- END test_loop --> diff --git a/tests/template/templates/loop_advanced.html b/tests/template/templates/loop_advanced.html index c75fe55f03..1f56686eaa 100644 --- a/tests/template/templates/loop_advanced.html +++ b/tests/template/templates/loop_advanced.html @@ -1,19 +1,19 @@ -<!-- BEGIN loop -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop --> +<!-- BEGIN test_loop -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop --> x -<!-- BEGIN loop(0) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop --> +<!-- BEGIN test_loop(0) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop --> x -<!-- BEGIN loop(0,-1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop --> +<!-- BEGIN test_loop(0,-1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop --> x -<!-- BEGIN loop(1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop --> +<!-- BEGIN test_loop(1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop --> x -<!-- BEGIN loop(1,1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop --> +<!-- BEGIN test_loop(1,1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop --> x -<!-- BEGIN loop(0,1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop --> +<!-- BEGIN test_loop(0,1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop --> x -<!-- BEGIN loop(2,4) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop --> +<!-- BEGIN test_loop(2,4) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop --> x -<!-- BEGIN loop(0,-7) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop --> +<!-- BEGIN test_loop(0,-7) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop --> x -<!-- BEGIN loop(-2,6) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop --> +<!-- BEGIN test_loop(-2,6) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop --> x -<!-- BEGIN loop(-2,-1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop --> +<!-- BEGIN test_loop(-2,-1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop --> diff --git a/tests/template/templates/loop_expressions.html b/tests/template/templates/loop_expressions.html new file mode 100644 index 0000000000..6bff53f388 --- /dev/null +++ b/tests/template/templates/loop_expressions.html @@ -0,0 +1,11 @@ +<!-- BEGIN loop --> + +<!-- IF loop.S_ROW_NUM is even by 4 -->on<!-- ELSE -->off<!-- ENDIF --> + +<!-- END loop --> + +<!-- BEGIN loop --> + +<!-- IF loop.S_ROW_NUM is odd by 3 -->on<!-- ELSE -->off<!-- ENDIF --> + +<!-- END loop --> diff --git a/tests/template/templates/loop_include.html b/tests/template/templates/loop_include.html new file mode 100644 index 0000000000..7bbdfc4248 --- /dev/null +++ b/tests/template/templates/loop_include.html @@ -0,0 +1,4 @@ +<!-- BEGIN test_loop --> +{test_loop.foo} + <!-- INCLUDE loop_include1.html --> +<!-- END test_loop --> diff --git a/tests/template/templates/loop_include1.html b/tests/template/templates/loop_include1.html new file mode 100644 index 0000000000..851f6e6e75 --- /dev/null +++ b/tests/template/templates/loop_include1.html @@ -0,0 +1 @@ +{test_loop.foo} diff --git a/tests/template/templates/loop_nested.html b/tests/template/templates/loop_nested.html index 9b251cd453..cf099ecc15 100644 --- a/tests/template/templates/loop_nested.html +++ b/tests/template/templates/loop_nested.html @@ -1,8 +1,6 @@ <!-- BEGIN outer --> - outer - {outer.S_ROW_COUNT}<!-- IF outer.VARIABLE --> - {outer.VARIABLE}<!-- ENDIF --> - - <!-- BEGIN middle --> - middle - {middle.S_ROW_COUNT}<!-- IF middle.VARIABLE --> - {middle.VARIABLE}<!-- ENDIF --> - - <!-- END middle --> +outer - {outer.S_ROW_COUNT}<!-- IF outer.VARIABLE --> - {outer.VARIABLE}<!-- ENDIF --><!-- IF TEST_MORE -->[{outer.S_BLOCK_NAME}|{outer.S_NUM_ROWS}]<!-- ENDIF --> +<!-- BEGIN middle --> +middle - {outer.middle.S_ROW_COUNT}<!-- IF outer.middle.VARIABLE --> - {outer.middle.VARIABLE}<!-- ENDIF --><!-- IF TEST_MORE -->[{outer.middle.S_BLOCK_NAME}|{outer.middle.S_NUM_ROWS}]<!-- ENDIF --> +<!-- END middle --> <!-- END outer --> diff --git a/tests/template/templates/loop_nested2.html b/tests/template/templates/loop_nested2.html new file mode 100644 index 0000000000..3eeeb5e36a --- /dev/null +++ b/tests/template/templates/loop_nested2.html @@ -0,0 +1,6 @@ +<!-- BEGIN outer --> +o{outer.S_ROW_COUNT} +<!-- BEGIN middle --> +m{outer.middle.S_ROW_COUNT}{outer.S_ROW_COUNT} +<!-- END middle --> +<!-- END outer --> diff --git a/tests/template/templates/loop_nested_deep_multilevel_ref.html b/tests/template/templates/loop_nested_deep_multilevel_ref.html new file mode 100644 index 0000000000..bcc2a7c07b --- /dev/null +++ b/tests/template/templates/loop_nested_deep_multilevel_ref.html @@ -0,0 +1,13 @@ +top-level content +<!-- BEGIN outer --> + outer + <!-- BEGIN middle --> + {outer.middle.S_BLOCK_NAME} + <!-- BEGIN inner --> + inner {inner.VARIABLE} + <!-- IF outer.middle.inner.S_FIRST_ROW --> + first row of {outer.middle.inner.S_NUM_ROWS} in {middle.inner.S_BLOCK_NAME} + <!-- ENDIF --> + <!-- END inner --> + <!-- END middle --> +<!-- END outer --> diff --git a/tests/template/templates/loop_nested_multilevel_ref.html b/tests/template/templates/loop_nested_multilevel_ref.html new file mode 100644 index 0000000000..f2f1c746ed --- /dev/null +++ b/tests/template/templates/loop_nested_multilevel_ref.html @@ -0,0 +1,10 @@ +top-level content +<!-- BEGIN outer --> + outer {outer.VARIABLE} + <!-- BEGIN inner --> + inner {inner.VARIABLE} + <!-- IF outer.inner.S_FIRST_ROW --> + first row + <!-- ENDIF --> + <!-- END inner --> +<!-- END outer --> diff --git a/tests/template/templates/loop_reuse.html b/tests/template/templates/loop_reuse.html new file mode 100644 index 0000000000..bd0354ae6f --- /dev/null +++ b/tests/template/templates/loop_reuse.html @@ -0,0 +1,6 @@ +<!-- BEGIN one --> + {one.VAR} + <!-- BEGIN one --> + {one.one.VAR} + <!-- END one --> +<!-- END one --> diff --git a/tests/template/templates/loop_size.html b/tests/template/templates/loop_size.html new file mode 100644 index 0000000000..2b1fcd2dd4 --- /dev/null +++ b/tests/template/templates/loop_size.html @@ -0,0 +1,39 @@ +<!-- IF .nonexistent_loop --> + nonexistent +<!-- ENDIF --> + +<!-- IF .nonexistent_loop == 0 --> + nonexistent = 0 +<!-- ENDIF --> + +<!-- IF ! .nonexistent_loop --> + ! nonexistent +<!-- ENDIF --> + +<!-- IF .empty_loop --> + empty +<!-- ENDIF --> + +<!-- IF .empty_loop == 0 --> + empty = 0 +<!-- ENDIF --> + +<!-- IF ! .empty_loop --> + ! empty +<!-- ENDIF --> + +<!-- IF .test_loop --> + loop +<!-- ENDIF --> + +<!-- IF .test_loop == 0 --> + loop = 0 +<!-- ENDIF --> + +<!-- IF ! .test_loop --> + ! loop +<!-- ENDIF --> + +<!-- BEGIN test_loop --> + in loop +<!-- END test_loop --> diff --git a/tests/template/templates/loop_underscore.html b/tests/template/templates/loop_underscore.html new file mode 100644 index 0000000000..4001007868 --- /dev/null +++ b/tests/template/templates/loop_underscore.html @@ -0,0 +1,21 @@ +<!-- BEGIN _underscore_loop --> +loop +<!-- BEGINELSE --> +noloop +<!-- END _underscore_loop --> + +<!-- IF ._underscore_loop --> +loop +<!-- ELSE --> +noloop +<!-- ENDIF --> + +<!-- IF ._underscore_loop == 2 --> +loop +<!-- ENDIF --> + +<!-- BEGIN _underscore_loop --> +<!-- BEGIN !block --> +loop#{loop.S_ROW_COUNT}-block#{block.S_ROW_COUNT} +<!-- END !block --> +<!-- END _underscore_loop --> diff --git a/tests/template/templates/loop_vars.html b/tests/template/templates/loop_vars.html index 4f02fd2e6c..70a3eb2cec 100644 --- a/tests/template/templates/loop_vars.html +++ b/tests/template/templates/loop_vars.html @@ -1,21 +1,13 @@ -<!-- BEGIN loop --> -<!-- IF loop.S_FIRST_ROW -->first<!-- ENDIF --> - -{loop.S_ROW_COUNT} - -{loop.VARIABLE} - -<!-- IF loop.VARIABLE -->set<!-- ENDIF --> - -<!-- IF loop.S_LAST_ROW --> +<!-- BEGIN test_loop --> +<!-- IF test_loop.S_FIRST_ROW -->first<!-- ENDIF --> +{test_loop.S_ROW_NUM} - a +{test_loop.VARIABLE} - b +<!-- IF test_loop.VARIABLE -->set<!-- ENDIF --> +<!-- IF test_loop.S_LAST_ROW --> last <!-- ENDIF --> <!-- BEGIN inner --> - -{inner.S_ROW_COUNT} - -<!-- IF inner.S_LAST_ROW and inner.S_ROW_COUNT and inner.S_NUM_ROWS -->last inner<!-- ENDIF --> - +{test_loop.inner.S_ROW_NUM} - c +<!-- IF test_loop.inner.S_LAST_ROW and test_loop.inner.S_ROW_COUNT and test_loop.inner.S_NUM_ROWS -->last inner<!-- ENDIF --> <!-- END inner --> -<!-- END loop --> -<!-- IF .loop.inner -->inner loop<!-- ENDIF --> +<!-- END test_loop --> diff --git a/tests/template/templates/parent_and_child.html b/tests/template/templates/parent_and_child.html new file mode 100644 index 0000000000..16223d91e7 --- /dev/null +++ b/tests/template/templates/parent_and_child.html @@ -0,0 +1 @@ +Child template. diff --git a/tests/template/templates/parent_and_child.js b/tests/template/templates/parent_and_child.js new file mode 100644 index 0000000000..d544d94d83 --- /dev/null +++ b/tests/template/templates/parent_and_child.js @@ -0,0 +1 @@ +// JavaScript file in a child style. diff --git a/tests/template/templates/subdir/parent_only.js b/tests/template/templates/subdir/parent_only.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/template/templates/subdir/parent_only.js diff --git a/tests/template/templates/subdir/subsubdir/parent_only.js b/tests/template/templates/subdir/subsubdir/parent_only.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/template/templates/subdir/subsubdir/parent_only.js diff --git a/tests/template/templates/subdir/variable.html b/tests/template/templates/subdir/variable.html new file mode 100644 index 0000000000..f68f91597c --- /dev/null +++ b/tests/template/templates/subdir/variable.html @@ -0,0 +1 @@ +{VARIABLE} diff --git a/tests/template/templates/trivial.html b/tests/template/templates/trivial.html new file mode 100644 index 0000000000..3a1c1c5324 --- /dev/null +++ b/tests/template/templates/trivial.html @@ -0,0 +1 @@ +This is a trivial template. diff --git a/tests/template/templates/twig.html b/tests/template/templates/twig.html new file mode 100644 index 0000000000..17b94ad8d4 --- /dev/null +++ b/tests/template/templates/twig.html @@ -0,0 +1,6 @@ +<!-- EXTENDS "twig_parent.html" --> + +<!-- BLOCK overwritten --> +3{VARIABLE|upper}|{VARIABLE|lower} +<!-- ENDBLOCK --> + diff --git a/tests/template/templates/twig_parent.html b/tests/template/templates/twig_parent.html new file mode 100644 index 0000000000..e9863221e1 --- /dev/null +++ b/tests/template/templates/twig_parent.html @@ -0,0 +1,7 @@ +<!-- BLOCK notoverwritten --> +1 +<!-- ENDBLOCK --> + +<!-- BLOCK overwritten --> +2 +<!-- ENDBLOCK --> diff --git a/tests/template/templates/variable_spacing.html b/tests/template/templates/variable_spacing.html new file mode 100644 index 0000000000..028f8aa0d1 --- /dev/null +++ b/tests/template/templates/variable_spacing.html @@ -0,0 +1,6 @@ +|{VARIABLE}| +{VARIABLE}|{VARIABLE}| + +|{VARIABLE} + +<div class="{VARIABLE}">test</div> |