forked from Wavyzz/dolibarr
Add more phpunit to avoid empty and hasRight
This commit is contained in:
@@ -552,6 +552,15 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
|
||||
}
|
||||
$this->assertTrue($ok, 'Found code empty($user->hasRight in file '.$file['relativename'].'. empty() must not be used with hasRight.');
|
||||
|
||||
// Test we don't have empty(DolibarrApiAccess::$user->hasRight
|
||||
$ok=true;
|
||||
$matches=array();
|
||||
preg_match_all('/empty\(DolibarrApiAccess::\$user->hasRight/', $filecontent, $matches, PREG_SET_ORDER);
|
||||
foreach ($matches as $key => $val) {
|
||||
$ok=false;
|
||||
break;
|
||||
}
|
||||
$this->assertTrue($ok, 'Found code empty(DolibarrApiAccess::$user->hasRight in file '.$file['relativename'].'. empty() must not be used with hasRight.');
|
||||
|
||||
// Test we don't have @var array(
|
||||
$ok=true;
|
||||
|
||||
Reference in New Issue
Block a user