mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 09:02:59 +01:00
FIX #8483
This commit is contained in:
@@ -437,17 +437,21 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testDolStringNohtmltag()
|
||||
{
|
||||
$text="A\nstring\n";
|
||||
$text="A\nstring\n\nand more\n";
|
||||
$after=dol_string_nohtmltag($text,0);
|
||||
$this->assertEquals("A\nstring",$after,"test1");
|
||||
$this->assertEquals("A\nstring\n\nand more",$after,"test1a");
|
||||
|
||||
$text="A <b>string<b>\n\nwith html tag and '<' chars<br>\n";
|
||||
$text="A <b>string<b><br>\n<br>\n\nwith html tag<br>\n";
|
||||
$after=dol_string_nohtmltag($text, 0);
|
||||
$this->assertEquals("A string\n\nwith html tag and '<' chars",$after,"test2");
|
||||
$this->assertEquals("A string\n\n\n\n\nwith html tag",$after,"test2a 2 br and 3 \n give 5 \n");
|
||||
|
||||
$text="A <b>string<b>\n\nwith tag with < chars<br>\n";
|
||||
$text="A <b>string<b><br>\n<br>\n\nwith html tag<br>\n";
|
||||
$after=dol_string_nohtmltag($text, 1);
|
||||
$this->assertEquals("A string with tag with < chars",$after,"test3");
|
||||
$this->assertEquals("A string with html tag",$after,"test2b 2 br and 3 \n give 1 space");
|
||||
|
||||
$text="A <b>string<b><br>\n<br>\n\nwith html tag<br>\n";
|
||||
$after=dol_string_nohtmltag($text, 2);
|
||||
$this->assertEquals("A string\n\nwith html tag",$after,"test2c 2 br and 3 \n give 2 \n");
|
||||
|
||||
$text="A string<br>Another string";
|
||||
$after=dol_string_nohtmltag($text,0);
|
||||
@@ -469,6 +473,14 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
||||
$after=dol_string_nohtmltag($text,0);
|
||||
$this->assertEquals("HIJ",$after,"test8");
|
||||
|
||||
$text="A <b>string<b>\n\nwith html tag and '<' chars<br>\n";
|
||||
$after=dol_string_nohtmltag($text, 0);
|
||||
$this->assertEquals("A string\n\nwith html tag and '<' chars",$after,"test9");
|
||||
|
||||
$text="A <b>string<b>\n\nwith tag with < chars<br>\n";
|
||||
$after=dol_string_nohtmltag($text, 1);
|
||||
$this->assertEquals("A string with tag with < chars",$after,"test10");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -830,7 +842,7 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
$s=img_picto('title', 'delete', '', 0, 1);
|
||||
print __METHOD__." s=".$s."\n";
|
||||
$this->assertEquals('/theme/eldy/img/delete.png',$s,'testImgPicto5');
|
||||
$this->assertEquals(DOL_URL_ROOT.'/theme/eldy/img/delete.png',$s,'testImgPicto5');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user