mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
Merge remote-tracking branch 'origin/support/3.1' into develop
This commit is contained in:
@@ -63,7 +63,7 @@ class StatusIncTest extends ItopTestCase {
|
||||
}
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @runInSeparateProcess Required because Status constructor invokes MetaModel::Startup... which does nothing when already loaded
|
||||
*/
|
||||
public function testStatusStartupWrongDbPwd()
|
||||
{
|
||||
|
||||
@@ -18,14 +18,6 @@ class StatusTest extends ItopTestCase
|
||||
require_once APPROOT.'core/config.class.inc.php'; // for constants
|
||||
}
|
||||
|
||||
public function testStatusWrongUrl() {
|
||||
$sPath = APPROOT.'/status_wrong.php';
|
||||
|
||||
exec("php $sPath", $aOutput, $iRet);
|
||||
$this->assertNotEquals(0, $iRet, "Problem executing status page: $sPath, $iRet, aOutput:\n" . var_export($aOutput, true));
|
||||
|
||||
}
|
||||
|
||||
protected function GetPHPCommand()
|
||||
{
|
||||
$this->RequireOnceItopFile('application/utils.inc.php');
|
||||
@@ -33,23 +25,14 @@ class StatusTest extends ItopTestCase
|
||||
return $oConfig->Get('php_path');
|
||||
}
|
||||
|
||||
public function testStatusGood() {
|
||||
$sPath = APPROOT.'/webservices/status.php';
|
||||
|
||||
$sPHP = $this->GetPHPCommand();
|
||||
exec("$sPHP $sPath", $aOutput, $iRet);
|
||||
$this->assertEquals(0, $iRet, "Problem executing status page: $sPath, $iRet, aOutput:\n".var_export($aOutput, true));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testStatusGoodWithJson()
|
||||
public function testStatusPageRepliesAsExpected()
|
||||
{
|
||||
$sPath = APPROOT.'/webservices/status.php';
|
||||
|
||||
$sPHP = $this->GetPHPCommand();
|
||||
exec("$sPHP $sPath", $aOutput, $iRet);
|
||||
$this->assertEquals(0, $iRet, "Problem executing status page: $sPath, $iRet, aOutput:\n".var_export($aOutput, true));
|
||||
|
||||
$sAdditionalInfo = "aOutput:\n".var_export($aOutput, true).'.';
|
||||
|
||||
//Check response
|
||||
|
||||
@@ -28,6 +28,10 @@ class RouterTest extends ItopDataTestCase
|
||||
parent::setUp();
|
||||
|
||||
$this->RequireOnceItopFile('setup/setuputils.class.inc.php');
|
||||
|
||||
// Speedup test by forcing the use of the cache, even on a development environment
|
||||
$oRouter = Router::GetInstance();
|
||||
$oRouter->SetUseCache(true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -203,12 +207,9 @@ class RouterTest extends ItopDataTestCase
|
||||
$this->fail("Cache file was not generated ($sRoutesCacheFilePath)");
|
||||
}
|
||||
|
||||
clearstatcache();
|
||||
$iFirstModificationTimestamp = filemtime($sRoutesCacheFilePath);
|
||||
$this->debug("Initial timestamp: $iFirstModificationTimestamp");
|
||||
|
||||
// Wait for just 1s to ensure timestamps would be different is the file is re-generated
|
||||
sleep(1);
|
||||
// Set its modification date in the past so that regenerating it will result in a new modification date without any doubt
|
||||
$iFirstModificationTimestamp = time() - 2;
|
||||
touch($sRoutesCacheFilePath, $iFirstModificationTimestamp);
|
||||
|
||||
// Call GetRoutes() again to see if cache gets re-generated or not
|
||||
$this->InvokeNonPublicMethod(Router::class, 'GetRoutes', $oRouter, []);
|
||||
|
||||
@@ -12,9 +12,6 @@ use Combodo\iTop\Service\TemporaryObjects\TemporaryObjectManager;
|
||||
use Combodo\iTop\Service\TemporaryObjects\TemporaryObjectRepository;
|
||||
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
|
||||
|
||||
/**
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class TemporaryObjectManagerTest extends ItopDataTestCase
|
||||
{
|
||||
const USE_TRANSACTION = true;
|
||||
|
||||
@@ -13,9 +13,6 @@ use Combodo\iTop\Service\TemporaryObjects\TemporaryObjectRepository;
|
||||
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
|
||||
use DBObject;
|
||||
|
||||
/**
|
||||
* @runTestsInSeparateProcesses
|
||||
*/
|
||||
class TemporaryObjectRepositoryTest extends ItopDataTestCase
|
||||
{
|
||||
const USE_TRANSACTION = true;
|
||||
|
||||
Reference in New Issue
Block a user