2
0
forked from Wavyzz/dolibarr

NEW add option keepspace into dol_string_nospecialchar()

This commit is contained in:
Laurent Destailleur
2023-04-26 18:25:56 +02:00
parent f45c4dc867
commit 86456e299c
3 changed files with 26 additions and 4 deletions

View File

@@ -673,6 +673,24 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase
}
/**
* testDolStringNoSpecial
*
* @return boolean
*/
public function testDolStringNoSpecial()
{
$text="A string with space and special char like ' or ° and more...\n";
$after=dol_string_nospecial($text, '_', '', '', 0);
$this->assertEquals("A_string_with_space_and_special_char_like___or___and_more...\n", $after, "testDolStringNoSpecial 1");
$text="A string with space and special char like ' or ° and more...\n";
$after=dol_string_nospecial($text, '_', '', '', 1);
$this->assertEquals("A string with space and special char like _ or _ and more...\n", $after, "testDolStringNoSpecial 2");
return true;
}
/**
* testDolStringNohtmltag
*