Fix phpunit

This commit is contained in:
Laurent Destailleur
2023-06-22 22:12:55 +02:00
parent a358b453ce
commit 42f963ad48

View File

@@ -266,9 +266,10 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
// Check if a var_dump has been forgotten
if (!preg_match('/test\/phpunit/', $file['fullname'])) {
if (! in_array($file['name'], array('class.nusoap_base.php'))) {
$ok=true;
$matches=array();
preg_match_all('/(.)\s*var_dump/', $filecontent, $matches, PREG_SET_ORDER);
preg_match_all('/(.)\s*var_dump\(/', $filecontent, $matches, PREG_SET_ORDER);
//var_dump($matches);
foreach ($matches as $key => $val) {
if ($val[1] != '/' && $val[1] != '*') {
@@ -281,6 +282,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
$this->assertTrue($ok, 'Found string var_dump that is not just after /* or // in '.$file['relativename']);
//exit;
}
}
// Check get_class followed by __METHOD__
$ok=true;