GivenObjectInDB() and additional improvements in the tests suite to address false positive and slow tests

Rewrite tests on impact analysis to make them readable in the first place, then simplifiy the tests to focus on risk reduction, then complete with some edge case
Rewrite tests on impact graph build when the current user has restricted access to some parts of the graph
This commit is contained in:
Eric Espie
2024-05-28 09:22:35 +02:00
committed by Romain Quetiez
parent b8d8ec640d
commit 984f676d6e
11 changed files with 1137 additions and 1116 deletions

View File

@@ -57,6 +57,19 @@ abstract class ItopTestCase extends TestCase
// setUp might be called multiple times, so protecting the define() call !
define(ITOP_PHPUNIT_RUNNING_CONSTANT_NAME, true);
}
// This is mostly for interactive usage, to warn the developer that the tests will be slow and point her to the php.ini file
static $bCheckedXDebug = false;
if (!$bCheckedXDebug) {
$bCheckedXDebug = true;
if (extension_loaded('xdebug') && ini_get('xdebug.mode') != '') {
echo "Xdebug is enabled (xdebug.mode='".ini_get('xdebug.mode')."'), this will slow down the tests.\n";
$sIniFile = php_ini_loaded_file();
if ($sIniFile) {
echo "This can be tuned in $sIniFile\n";
}
}
}
}
/**