From c609f25bae6aee2b7fab8dfeb8b3a58e2c2f396f Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Mon, 4 Nov 2013 12:15:02 -0600 Subject: [ticket/11943] Add test for DEFINE $VAR = false PHPBB3-11943 --- tests/template/template_test.php | 2 +- tests/template/templates/define.html | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/template/template_test.php b/tests/template/template_test.php index 39eb08ab79..0ff469779d 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', 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' [{$VALUE}] foobar|{$TEST}| + + +true + +false + -- cgit v1.2.1 From 2e5117a71eb64c734e5738235c44ef92818ca33b Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sat, 9 Nov 2013 11:14:55 -0600 Subject: [ticket/11943] Throw an exception if DEFINE is setup improperly PHPBB3-11943 --- tests/template/template_test.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/template/template_test.php b/tests/template/template_test.php index 0ff469779d..6e9b7d3ee9 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -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(), ''); + } } -- cgit v1.2.1 From 64ed46e682564600c8b8688e7d4e49620eb79bb3 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sat, 9 Nov 2013 11:39:35 -0600 Subject: [ticket/11943] Forgot template file for test PHPBB3-11943 --- tests/template/templates/define_error.html | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/template/templates/define_error.html (limited to 'tests') diff --git a/tests/template/templates/define_error.html b/tests/template/templates/define_error.html new file mode 100644 index 0000000000..a272071736 --- /dev/null +++ b/tests/template/templates/define_error.html @@ -0,0 +1,2 @@ + +{$VAR} \ No newline at end of file -- cgit v1.2.1 From 47e364ae68a92dbf2107c56a2165b219e4312b50 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Mon, 11 Nov 2013 10:59:17 -0600 Subject: [ticket/11943] New line at EOF for define_error.html PHPBB3-11943 --- tests/template/templates/define_error.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/template/templates/define_error.html b/tests/template/templates/define_error.html index a272071736..72ab1ba033 100644 --- a/tests/template/templates/define_error.html +++ b/tests/template/templates/define_error.html @@ -1,2 +1,2 @@ -{$VAR} \ No newline at end of file +{$VAR} -- cgit v1.2.1