Create and set new configuration directories.
The child site uses drupal_valid_test_ua() to adjust the config directory paths to a test-prefix-specific directory within the public files directory.
protected function prepareConfigDirectories() {
$GLOBALS['config_directories'] = array();
$this->configDirectories = array();
include_once DRUPAL_ROOT . '/core/includes/install.inc';
foreach (array(
CONFIG_ACTIVE_DIRECTORY,
CONFIG_STAGING_DIRECTORY,
) as $type) {
// Assign the relative path to the global variable.
$path = 'simpletest/' . substr($this->databasePrefix, 10) . '/config_' . $type;
$GLOBALS['config_directories'][$type]['path'] = $path;
// Ensure the directory can be created and is writeable.
if (!install_ensure_config_directory($type)) {
return FALSE;
}
// Provide the already resolved path for tests.
$this->configDirectories[$type] = $this->originalFileDirectory . '/' . $path;
}
}