Skip to content

Commit

Permalink
Add unit tests for short hand template function definition and shorth…
Browse files Browse the repository at this point in the history
…and template function calls.
  • Loading branch information
wisskid committed Oct 6, 2024
1 parent cd58df7 commit a1b4c9c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{function blah}gribus{/function}
{call name=blah}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{function name=blah}gribus{/function}
{blah}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{function blah}gribus{/function}
{blah}

0 comments on commit a1b4c9c

Please sign in to comment.