refactoring configuration

This commit is contained in:
El RIDO
2015-09-22 23:21:31 +02:00
parent 9f68658106
commit 6d24ff824e
6 changed files with 308 additions and 139 deletions

View File

@@ -589,7 +589,7 @@ class configurationTestGenerator
return <<<'EOT'
<?php
/**
* DO NOT EDIT: This file is automatically generated by configGenerator.php
* DO NOT EDIT: This file is generated automatically using configGenerator.php
*/
class configurationTest extends PHPUnit_Framework_TestCase
{
@@ -600,9 +600,7 @@ class configurationTest extends PHPUnit_Framework_TestCase
public function setUp()
{
/* Setup Routine */
$this->_conf = PATH . 'cfg' . DIRECTORY_SEPARATOR . 'conf.ini';
if (!is_file($this->_conf . '.bak') && is_file($this->_conf))
rename($this->_conf, $this->_conf . '.bak');
helper::confBackup();
$this->_model = zerobin_data::getInstance(array('dir' => PATH . 'data'));
serversalt::setPath(PATH . 'data');
@@ -612,7 +610,7 @@ class configurationTest extends PHPUnit_Framework_TestCase
public function tearDown()
{
/* Tear Down Routine */
rename($this->_conf . '.bak', $this->_conf);
helper::confRestore();
}
public function reset($configuration = array())
@@ -622,7 +620,7 @@ class configurationTest extends PHPUnit_Framework_TestCase
$_SERVER = array();
if ($this->_model->exists(helper::getPasteId()))
$this->_model->delete(helper::getPasteId());
helper::createIniFile($this->_conf, $configuration);
helper::createIniFile(CONF, $configuration);
}