diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php index 863ca6c41..16892ed04 100644 --- a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php @@ -442,4 +442,28 @@ public function testIllegalFunctionName() { $this->smarty->fetch('string:{function name=\'rce(){};echo "hi";function \'}{/function}'); } + /** + * test shorthand function definition with regular call + */ + public function testShorthand1() + { + $this->assertEquals("gribus", $this->smarty->fetch('shorthand1.tpl')); + } + + /** + * test normal function definition with shorthand call + */ + public function testShorthand2() + { + $this->assertEquals("gribus", $this->smarty->fetch('shorthand2.tpl')); + } + + /** + * test shorthand function definition with shorthand call + */ + public function testShorthand3() + { + $this->assertEquals("gribus", $this->smarty->fetch('shorthand3.tpl')); + } + } diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates/shorthand1.tpl b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates/shorthand1.tpl new file mode 100644 index 000000000..1ca50d703 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates/shorthand1.tpl @@ -0,0 +1,2 @@ +{function blah}gribus{/function} +{call name=blah} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates/shorthand2.tpl b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates/shorthand2.tpl new file mode 100644 index 000000000..2901a3d50 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates/shorthand2.tpl @@ -0,0 +1,2 @@ +{function name=blah}gribus{/function} +{blah} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates/shorthand3.tpl b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates/shorthand3.tpl new file mode 100644 index 000000000..61be22559 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates/shorthand3.tpl @@ -0,0 +1,2 @@ +{function blah}gribus{/function} +{blah} \ No newline at end of file