mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-22 01:58:47 +02:00
CI migration/automation + new test to ease iTop release management
- new Jenkinsfile and .jenkins removal to launch phpunit/behat tests triggered on both iTop build and push. - N°3053 - Check XML conversion methods - N°3057 - New build recipe - N°3059 - Automatically set the documentation URLs - N°3052 - Check community modules XML version against latest version - N°3054 - Check community modules version against major version - N°3062 - setup.css file integrity test - N°3060 - Check consistency between the list of modules and installation.xml - Add exclusion group for CI - N°3061 - Automatically check the installation.xml consistency
This commit is contained in:
@@ -9,13 +9,35 @@ use Combodo\iTop\Test\UnitTest\ItopTestCase;
|
||||
|
||||
class iTopConfigParserTest extends ItopTestCase
|
||||
{
|
||||
private $conf_exists;
|
||||
private $tmpSavePath;
|
||||
private $sConfigPath;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
require_once APPROOT.'/core/iTopConfigParser.php';
|
||||
|
||||
clearstatcache();
|
||||
$this->sConfigPath = utils::GetConfigFilePath();
|
||||
$this->tmpSavePath = tempnam( '/tmp/', 'config-itop');
|
||||
|
||||
$this->conf_exists = is_file($this->sConfigPath);
|
||||
if ($this->conf_exists)
|
||||
{
|
||||
copy($this->sConfigPath, $this->tmpSavePath);
|
||||
}
|
||||
clearstatcache();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown(); // TODO: Change the autogenerated stub
|
||||
if ($this->conf_exists)
|
||||
{
|
||||
rename($this->tmpSavePath, $this->sConfigPath);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider ParserProvider
|
||||
@@ -185,30 +207,13 @@ CONF;
|
||||
public function testConfigWriteToFile_FromScratchInstallation()
|
||||
{
|
||||
$sConfigPath = utils::GetConfigFilePath();
|
||||
$tmpSavePath = tempnam( '/tmp/', 'config-itop');
|
||||
|
||||
$conf_exists = is_file($sConfigPath);
|
||||
if ($conf_exists)
|
||||
{
|
||||
rename($sConfigPath, $tmpSavePath);
|
||||
}
|
||||
|
||||
$oConfig = new Config($sConfigPath, false);
|
||||
try{
|
||||
clearstatcache();
|
||||
$oConfig->WriteToFile();
|
||||
if ($conf_exists)
|
||||
{
|
||||
rename($tmpSavePath, $sConfigPath);
|
||||
}
|
||||
}catch(\Exception $e)
|
||||
{
|
||||
if ($conf_exists)
|
||||
{
|
||||
rename($tmpSavePath, $sConfigPath);
|
||||
}
|
||||
|
||||
$this->assertTrue(false, "failed writetofile with no initial file");
|
||||
$this->assertTrue(false, "failed writetofile with no initial file: " . $e->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user