- self::$configFields = array(
- 'login' => 'login',
- 'hash' => 'hash',
- 'salt' => 'salt',
- 'timezone' => 'Europe/Paris',
- 'title' => 'title',
- 'titleLink' => 'titleLink',
- 'redirector' => '',
- 'disablesessionprotection' => false,
- 'privateLinkByDefault' => false,
- 'config' => array(
- 'DATADIR' => 'tests/Updater',
- 'PAGECACHE' => 'sandbox/pagecache',
- 'config1' => 'config1data',
- 'config2' => 'config2data',
- )
- );
-
- ConfigManager::$CONFIG_FILE = self::$configFile;
- $this->conf = ConfigManager::reset();
- $this->conf->reload();
- foreach (self::$configFields as $key => $value) {
- $this->conf->set($key, $value);
- }
- $this->conf->write(true);
- }
-
- /**
- * Executed after each test.
- *
- * @return void
- */
- public function tearDown()
- {
- if (is_file('tests/Updater/config.json')) {
- unlink('tests/Updater/config.json');
- }
-
- if (is_file(self::$configFields['config']['DATADIR'] . '/options.php')) {
- unlink(self::$configFields['config']['DATADIR'] . '/options.php');
- }
-
- if (is_file(self::$configFields['config']['DATADIR'] . '/updates.txt')) {
- unlink(self::$configFields['config']['DATADIR'] . '/updates.txt');
- }