2 require_once 'include/Smarty/plugins/function.sugar_help.php';
3 require_once 'include/Sugar_Smarty.php';
5 class FunctionSugarHelpTest extends Sugar_PHPUnit_Framework_TestCase
7 public function setUp()
9 $this->_smarty = new Sugar_Smarty;
12 public function providerSpecialCharactersHandledInTextParameter()
16 'dog "the" bounty hunter & friends are <b>cool</b>',
17 'dog "the" bounty hunter & friends are <b>cool</b>',
20 "dog 'the' bounty hunter",
21 "dog \'the\' bounty hunter"
27 * @dataProvider providerSpecialCharactersHandledInTextParameter
29 public function testSpecialCharactersHandledInTextParameter(
34 $this->assertContains($returnedString, smarty_function_sugar_help(array('text'=>$string),$this->_smarty));
37 public function testExtraParametersAreAdded()
39 $string = 'my string';
41 $output = smarty_function_sugar_help(array('text'=>$string,'foo'=>'bar'),$this->_smarty);
43 $this->assertContains(",foo,bar",$output);