Fix Add unit test to avoid the big % instead of comon % char.
This commit is contained in:
parent
024e62a582
commit
3dca55661c
@ -250,11 +250,11 @@ foreach($filesToProcess as $fileToProcess)
|
|||||||
{
|
{
|
||||||
if ( ! $oh = fopen($output, 'w') )
|
if ( ! $oh = fopen($output, 'w') )
|
||||||
{
|
{
|
||||||
print "ERROR in writing to file $output\n";
|
print "ERROR in writing to file ".$output."\n";
|
||||||
exit;
|
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");
|
fwrite($oh, "# Dolibarr language file - Source file is en_US - ".(preg_replace('/\.lang$/', '', $fileToProcess))."\n");
|
||||||
|
|
||||||
|
|||||||
@ -181,6 +181,20 @@ class LangTest extends PHPUnit\Framework\TestCase
|
|||||||
$this->assertRegExp('/^[dMy\/\-\.]+$/', $result, 'FormatDateShortJavaInput KO for lang code '.$code);
|
$this->assertRegExp('/^[dMy\/\-\.]+$/', $result, 'FormatDateShortJavaInput KO for lang code '.$code);
|
||||||
|
|
||||||
unset($tmplangs);
|
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;
|
return;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user