2
0
forked from Wavyzz/dolibarr

Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	test/phpunit/CodingPhpTest.php
This commit is contained in:
Laurent Destailleur
2021-02-03 23:26:08 +01:00
3 changed files with 19 additions and 8 deletions

View File

@@ -376,7 +376,18 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
break;
}
$this->assertTrue($ok, 'Found a declaration @var array() instead of @var array in file '.$file['relativename'].'.');
}
// Test we don't have CURDATE()
$ok=true;
$matches=array();
preg_match_all('/CURDATE\(\)/', $filecontent, $matches, PREG_SET_ORDER);
foreach ($matches as $key => $val) {
$ok=false;
break;
}
$this->assertTrue($ok, 'Found a CURDATE\(\) into code. Do not use this SQL method in file '.$file['relativename'].'. You must use the PHP function dol_now() instead.');
}
return;
}