mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-09 17:32:35 +01:00
Add more phpunit to aclude lang file with a simple % character.
This commit is contained in:
@@ -249,6 +249,11 @@ class LangTest extends CommonClassTest
|
||||
//print $prefix."Result for checking we don't have bad percent char = ".$result.PHP_EOL;
|
||||
$this->assertTrue($result === false, 'Found a bad percent char % instead of % in file '.$code.'/'.$file);
|
||||
|
||||
$reg = array();
|
||||
$result = preg_match('/(.*)([^%])%$/m', $filecontent, $reg); // A sequence of char we don't want
|
||||
//print $prefix."Result for checking we don't have bad percent char = ".$result.PHP_EOL;
|
||||
$this->assertTrue($result == 0, 'Found the character % alone in the translation file '.$code.'/'.$file.' on line '.(empty($reg[1]) ? '' : $reg[1]).(empty($reg[2]) ? '' : $reg[2]).'. We probably want %s or %%');
|
||||
|
||||
$result = preg_match('/%n/m', $filecontent); // A sequence of char we don't want
|
||||
//print $prefix."Result for checking we don't have bad percent char = ".$result.PHP_EOL;
|
||||
$this->assertTrue($result == 0, 'Found a sequence %n in the translation file '.$code.'/'.$file.'. We probably want %s');
|
||||
|
||||
Reference in New Issue
Block a user