Skip to content
Snippets Groups Projects
Commit 2750384b authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Changes to config modification for tests. Tests can now change configs back to back without error.

parent e92d1a3b
No related merge requests found
......@@ -75,7 +75,6 @@ abstract class MinkTestCase extends DbTestCase
{
foreach ($configs as $file => $settings) {
$this->changeConfigFile($file, $settings, in_array($file, $replace));
$this->modifiedConfigs[] = $file;
}
}
......@@ -93,14 +92,17 @@ abstract class MinkTestCase extends DbTestCase
{
$file = $configName . '.ini';
$local = ConfigLocator::getLocalConfigPath($file, null, true);
if (file_exists($local)) {
// File exists? Make a backup!
copy($local, $local . '.bak');
} else {
// File doesn't exist? Make a baseline version.
copy(ConfigLocator::getBaseConfigPath($file), $local);
}
if (!in_array($configName, $this->modifiedConfigs)) {
if (file_exists($local)) {
// File exists? Make a backup!
copy($local, $local . '.bak');
} else {
// File doesn't exist? Make a baseline version.
copy(ConfigLocator::getBaseConfigPath($file), $local);
}
$this->modifiedConfigs[] = $configName;
}
// If we're replacing the existing file, wipe it out now:
if ($replace) {
file_put_contents($local, '');
......@@ -218,6 +220,7 @@ abstract class MinkTestCase extends DbTestCase
rename($backup, $local);
}
}
$this->modifiedConfigs = [];
}
/**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment