Fix Add unit test to avoid the big % instead of comon % char.

This commit is contained in:
Laurent Destailleur 2020-05-23 22:01:17 +02:00
parent 024e62a582
commit 3dca55661c
2 changed files with 16 additions and 2 deletions

View File

@ -250,11 +250,11 @@ foreach($filesToProcess as $fileToProcess)
{
if ( ! $oh = fopen($output, 'w') )
{
print "ERROR in writing to file $output\n";
print "ERROR in writing to file ".$output."\n";
exit;
}
print "Read Primary File $lPrimaryFile and write ".$output.":\n";
print "Read Primary File ".$lPrimaryFile." and write ".$output.":\n";
fwrite($oh, "# Dolibarr language file - Source file is en_US - ".(preg_replace('/\.lang$/', '', $fileToProcess))."\n");

View File

@ -181,6 +181,20 @@ class LangTest extends PHPUnit\Framework\TestCase
$this->assertRegExp('/^[dMy\/\-\.]+$/', $result, 'FormatDateShortJavaInput KO for lang code '.$code);
unset($tmplangs);
$filesarray2 = scandir(DOL_DOCUMENT_ROOT.'/langs/'.$code);
foreach($filesarray2 as $key => $file) {
if (! preg_match('/\.lang$/', $file)) {
continue;
}
print 'Check lang file '.$file."\n";
$filecontent=file_get_contents(DOL_DOCUMENT_ROOT.'/langs/'.$code.'/'.$file);
$result=strpos($filecontent, '');
print __METHOD__." Result for checking we don't have bad percent char = ".$result."\n";
$this->assertTrue($result===false, 'Found a bad percent char instead of % into file '.$code.'/'.$file);
}
}
return;