mirror of
https://github.com/smarty-php/smarty.git
synced 2025-07-30 07:57:14 +02:00
Add unit tests for short hand template function definition and shorthand template function calls.
This commit is contained in:
@ -442,4 +442,28 @@ class CompileFunctionTest extends PHPUnit_Smarty
|
|||||||
$this->smarty->fetch('string:{function name=\'rce(){};echo "hi";function \'}{/function}');
|
$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'));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
{function blah}gribus{/function}
|
||||||
|
{call name=blah}
|
@ -0,0 +1,2 @@
|
|||||||
|
{function name=blah}gribus{/function}
|
||||||
|
{blah}
|
@ -0,0 +1,2 @@
|
|||||||
|
{function blah}gribus{/function}
|
||||||
|
{blah}
|
Reference in New Issue
Block a user