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

@@ -20,9 +20,7 @@ class StatusTest extends ItopTestCase
protected function GetPHPCommand()
{
$this->RequireOnceItopFile('application/utils.inc.php');
$oConfig = new Config(ITOP_DEFAULT_CONFIG_FILE);
return $oConfig->Get('php_path');
return PHP_BINARY;
}
public function testStatusPageRepliesAsExpected()
@@ -30,6 +28,7 @@ class StatusTest extends ItopTestCase
$sPath = APPROOT.'/webservices/status.php';
$sPHP = $this->GetPHPCommand();
echo "About to execute: $sPHP $sPath\n";
exec("$sPHP $sPath", $aOutput, $iRet);
$this->assertEquals(0, $iRet, "Problem executing status page: $sPath, $iRet, aOutput:\n".var_export($aOutput, true));