mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-07 10:08:27 +01:00
Fix phpunit
This commit is contained in:
@@ -266,20 +266,22 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
|
|||||||
|
|
||||||
// Check if a var_dump has been forgotten
|
// Check if a var_dump has been forgotten
|
||||||
if (!preg_match('/test\/phpunit/', $file['fullname'])) {
|
if (!preg_match('/test\/phpunit/', $file['fullname'])) {
|
||||||
$ok=true;
|
if (! in_array($file['name'], array('class.nusoap_base.php'))) {
|
||||||
$matches=array();
|
$ok=true;
|
||||||
preg_match_all('/(.)\s*var_dump/', $filecontent, $matches, PREG_SET_ORDER);
|
$matches=array();
|
||||||
//var_dump($matches);
|
preg_match_all('/(.)\s*var_dump\(/', $filecontent, $matches, PREG_SET_ORDER);
|
||||||
foreach ($matches as $key => $val) {
|
//var_dump($matches);
|
||||||
if ($val[1] != '/' && $val[1] != '*') {
|
foreach ($matches as $key => $val) {
|
||||||
$ok=false;
|
if ($val[1] != '/' && $val[1] != '*') {
|
||||||
|
$ok=false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
//print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n";
|
||||||
|
$this->assertTrue($ok, 'Found string var_dump that is not just after /* or // in '.$file['relativename']);
|
||||||
|
//exit;
|
||||||
}
|
}
|
||||||
//print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n";
|
|
||||||
$this->assertTrue($ok, 'Found string var_dump that is not just after /* or // in '.$file['relativename']);
|
|
||||||
//exit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check get_class followed by __METHOD__
|
// Check get_class followed by __METHOD__
|
||||||
|
|||||||
Reference in New Issue
Block a user