From 8beca79ba5e9c6ff7af99b186db91d6bed773a2c 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 UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates/001_closedBlock.tpl diff --git a/UnitTests/TemplateSource/ValueTests/DoubleQuoted/DoubleQuotedStringTest.php b/UnitTests/TemplateSource/ValueTests/DoubleQuoted/DoubleQuotedStringTest.php index 9a2e310..cf5eda2 100644 --- a/UnitTests/TemplateSource/ValueTests/DoubleQuoted/DoubleQuotedStringTest.php +++ b/UnitTests/TemplateSource/ValueTests/DoubleQuoted/DoubleQuotedStringTest.php @@ -86,9 +86,20 @@ public function dataTestDoubleQuoted() * @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/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates/001_closedBlock.tpl b/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates/001_closedBlock.tpl new file mode 100644 index 0000000..1ae6304 --- /dev/null +++ b/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/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates/001_unclosedBlock.tpl b/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates/001_unclosedBlock.tpl index 4b00987..f30d396 100644 --- a/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates/001_unclosedBlock.tpl +++ b/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