Ejemplo n.º 1
0
 /**
  * This function makes a backup copy of the config file to ensure that tests which write change
  * to the config file are able to roll-back their changes by calling restoreConfig
  *
  */
 static function backupConfig()
 {
     $backupConfigFilename =& $GLOBALS['_MAX']['TEST']['backupConfigFilename'];
     if (empty($backupConfigFilename)) {
         $backupConfigFilename = MAX_PATH . '/var/' . uniqid('backup') . '.conf.php';
     }
     $configFile = TestEnv::getConfigFilename();
     // Backup user's original config file
     if (file_exists($configFile)) {
         return @copy($configFile, $backupConfigFilename);
     }
     return false;
 }