From 37288b44e010a4a7f6edb87078540ae37c1a5f08 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Wed, 18 Oct 2017 09:12:59 +0200 Subject: [PATCH] update tests to cover https://github.com/smarty-php/smarty/issues/396 https://github.com/smarty-php/smarty/issues/397 https://github.com/smarty-php/smarty/issues/391 https://github.com/smarty-php/smarty/issues/392 --- .../DoubleQuoted/DoubleQuotedStringTest.php | 13 ++++++++++++- .../DoubleQuoted/templates/001_closedBlock.tpl | 1 + .../DoubleQuoted/templates/001_unclosedBlock.tpl | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates/001_closedBlock.tpl diff --git a/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/DoubleQuotedStringTest.php b/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/DoubleQuotedStringTest.php index 9a2e3101..cf5eda23 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/DoubleQuotedStringTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/DoubleQuotedStringTest.php @@ -86,9 +86,20 @@ class DoubleQuotedStringTest extends PHPUnit_Smarty * @expectedException SmartyCompilerException * @expectedExceptionMessage unclosed "{if}" in doubled quoted string */ - public function testtestDoubleQuotedUnclosedBlock_001() + public function testDoubleQuotedUnclosedBlock_001() { $this->smarty->fetch('001_unclosedBlock.tpl'); } + /** + * + * test closed block tag + * {"{if true}hello world{/if}"} + * + */ + public function testDoubleQuotedClosedBlock_001() + { + $this->assertEquals('hello world', $this->smarty->fetch('001_closedBlock.tpl')); + } + } diff --git a/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates/001_closedBlock.tpl b/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates/001_closedBlock.tpl new file mode 100644 index 00000000..1ae63043 --- /dev/null +++ b/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates/001_closedBlock.tpl @@ -0,0 +1 @@ +{"{if true}hello world{/if}"} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates/001_unclosedBlock.tpl b/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates/001_unclosedBlock.tpl index 4b009875..f30d396c 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates/001_unclosedBlock.tpl +++ b/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates/001_unclosedBlock.tpl @@ -1 +1 @@ -{"hello {if true} world"} \ No newline at end of file +{"{if true} world"} \ No newline at end of file