mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-14 08:54:21 +01:00
Add phpunit for make_substitutions
This commit is contained in:
@@ -1140,4 +1140,23 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* testDolGetDate
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function testMakeSubstitutions()
|
||||
{
|
||||
global $conf, $langs;
|
||||
$langs->load("main");
|
||||
|
||||
$substit=array("AAA"=>'Not used', "BBB"=>'Not used', "CCC"=>"C replaced");
|
||||
$chaine='This is a string with __[MAIN_THEME]__ and __(DIRECTION)__ and __CCC__';
|
||||
$newstring = make_substitutions($chaine, $substit);
|
||||
$this->assertEquals($newstring, 'This is a string with eldy and ltr and __C replaced__');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user