mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 06:28:46 +02:00
Merge remote-tracking branch 'origin/support/3.0' into develop
# Conflicts: # tests/php-unit-tests/unitary-tests/webservices/RestTest.php
This commit is contained in:
@@ -38,13 +38,15 @@ class OQLTest extends ItopDataTestCase
|
||||
*/
|
||||
public function testOQLSetup()
|
||||
{
|
||||
utils::GetConfig()->Set('apc_cache.enabled', false, 'test');
|
||||
utils::GetConfig()->Set('query_cache_enabled', false, 'test');
|
||||
utils::GetConfig()->Set('expression_cache_enabled', false, 'test');
|
||||
$sConfigFile = utils::GetConfig()->GetLoadedFile();
|
||||
$oConfig = utils::GetConfig();
|
||||
$oConfig->Set('apc_cache.enabled', false, 'test');
|
||||
$oConfig->Set('query_cache_enabled', false, 'test');
|
||||
$oConfig->Set('expression_cache_enabled', false, 'test');
|
||||
|
||||
$sConfigFile = $oConfig->GetLoadedFile();
|
||||
@chmod($sConfigFile, 0770);
|
||||
utils::GetConfig()->WriteToFile();
|
||||
@chmod($sConfigFile, 0444); // Read-only
|
||||
$oConfig->WriteToFile();
|
||||
@chmod($sConfigFile, 0444);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,10 +44,10 @@ class iTopConfigParserTest extends ItopTestCase
|
||||
parent::tearDown();
|
||||
if ($this->conf_exists) {
|
||||
// restoring config that was in place before the test
|
||||
$sBackupConfigFileContent = file_get_contents($this->tmpSavePath);
|
||||
$hItopConfigFile = @fopen($this->sConfigPath, 'w');
|
||||
fwrite($hItopConfigFile, $sBackupConfigFileContent);
|
||||
fclose($hItopConfigFile);
|
||||
@chmod($this->sConfigPath, 0770);
|
||||
$bRenameResult = rename($this->tmpSavePath, $this->sConfigPath);
|
||||
echo "Restored config file, result={$bRenameResult}";
|
||||
@chmod($this->sConfigPath, 0440);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user