mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
NEW data files are now also parsed by phpunit for sql syntax
This commit is contained in:
@@ -141,7 +141,7 @@ class CodingSqlTest extends PHPUnit_Framework_TestCase
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
$listofsqldir = array(DOL_DOCUMENT_ROOT.'/install/mysql/tables', DOL_DOCUMENT_ROOT.'/install/mysql/migration');
|
||||
$listofsqldir = array(DOL_DOCUMENT_ROOT.'/install/mysql/data', DOL_DOCUMENT_ROOT.'/install/mysql/tables', DOL_DOCUMENT_ROOT.'/install/mysql/migration');
|
||||
|
||||
foreach ($listofsqldir as $dir)
|
||||
{
|
||||
@@ -161,8 +161,12 @@ class CodingSqlTest extends PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($result===false, 'Found back quote into '.$file.'. Bad.');
|
||||
|
||||
$result=strpos($filecontent,'"');
|
||||
if ($result)
|
||||
{
|
||||
$result=! strpos($filecontent,'["');
|
||||
}
|
||||
print __METHOD__." Result for checking we don't have double quote = ".$result."\n";
|
||||
$this->assertTrue($result===false, 'Found double quote into '.$file.'. Bad.');
|
||||
$this->assertTrue($result===false, 'Found double quote that is not [" (used for json content) into '.$file.'. Bad.');
|
||||
|
||||
$result=strpos($filecontent,'int(');
|
||||
print __METHOD__." Result for checking we don't have 'int(' instead of 'integer' = ".$result."\n";
|
||||
@@ -176,6 +180,11 @@ class CodingSqlTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
// Test for migration files only
|
||||
|
||||
}
|
||||
elseif ($dir == DOL_DOCUMENT_ROOT.'/install/mysql/data')
|
||||
{
|
||||
// Test for data files only
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user