diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-11-11 18:23:37 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2013-11-11 18:23:37 +0100 |
commit | cfb0a4103083c4787beca30671d16eede92bd571 (patch) | |
tree | 5c76bc1b1c9bba12a16c13063eb40523682b2094 /tests | |
parent | 4bd078e00fd5994e7fbe0e65b00fa93d082ac383 (diff) | |
parent | 47e364ae68a92dbf2107c56a2165b219e4312b50 (diff) | |
download | forums-cfb0a4103083c4787beca30671d16eede92bd571.tar forums-cfb0a4103083c4787beca30671d16eede92bd571.tar.gz forums-cfb0a4103083c4787beca30671d16eede92bd571.tar.bz2 forums-cfb0a4103083c4787beca30671d16eede92bd571.tar.xz forums-cfb0a4103083c4787beca30671d16eede92bd571.zip |
Merge remote-tracking branch 'EXreaction/ticket/11943' into develop
* EXreaction/ticket/11943:
[ticket/11943] New line at EOF for define_error.html
[ticket/11943] Forgot template file for test
[ticket/11943] Throw an exception if DEFINE is setup improperly
[ticket/11943] Split fix_inline_variable_tokens into 3 steps
[ticket/11943] Require stricter DEFINE statements for templates
[ticket/11943] Do not quote the value when it is exactly true, false, or null
[ticket/11943] Add test for DEFINE $VAR = false
Diffstat (limited to 'tests')
-rw-r--r-- | tests/template/template_test.php | 10 | ||||
-rw-r--r-- | tests/template/templates/define.html | 6 | ||||
-rw-r--r-- | tests/template/templates/define_error.html | 2 |
3 files changed, 17 insertions, 1 deletions
diff --git a/tests/template/template_test.php b/tests/template/template_test.php index 39eb08ab79..6e9b7d3ee9 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -158,7 +158,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case array(), array('test_loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())), array(), - "xyz\nabc\n\$VALUE == 'abc'\n(\$VALUE == 'abc')\n((\$VALUE == 'abc'))\n!\$DOESNT_EXIST\n(!\$DOESNT_EXIST)\nabc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?[]|foobar|", + "xyz\nabc\n\$VALUE == 'abc'\n(\$VALUE == 'abc')\n((\$VALUE == 'abc'))\n!\$DOESNT_EXIST\n(!\$DOESNT_EXIST)\nabc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?[]|foobar|false", ), array( 'define_advanced.html', @@ -561,4 +561,12 @@ EOT $expect = 'outer - 0[outer|4]outer - 1[outer|4]middle - 0[middle|1]outer - 2 - test[outer|4]middle - 0[middle|2]middle - 1[middle|2]outer - 3[outer|4]middle - 0[middle|3]middle - 1[middle|3]middle - 2[middle|3]'; $this->assertEquals($expect, str_replace(array("\n", "\r", "\t"), '', $this->display('test')), 'Ensuring S_NUM_ROWS is correct after modification'); } + + /** + * @expectedException Twig_Error_Syntax + */ + public function test_define_error() + { + $this->run_template('define_error.html', array(), array(), array(), ''); + } } diff --git a/tests/template/templates/define.html b/tests/template/templates/define.html index e7ce7f7def..276d2ebb99 100644 --- a/tests/template/templates/define.html +++ b/tests/template/templates/define.html @@ -29,3 +29,9 @@ $VALUE == 'abc' <!-- DEFINE $VALUE = '' --> [{$VALUE}] <!-- DEFINE $TEST -->foobar<!-- ENDDEFINE -->|{$TEST}| +<!-- DEFINE $VAR = false --> +<!-- IF $VAR --> +true +<!-- ELSE --> +false +<!-- ENDIF --> 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} |