Determines whether to use an overridden value for conf_path().
Simpletest may provide a secondary, test-specific settings.php file to load after the primary one used by the parent site and override its variables.
returns FALSE and conf_path() returns the directory of the primary settings.php.
_drupal_load_test_overrides() sets the 'simpletest_conf_path' setting, and this function returns that to conf_path(), causing installations and upgrades to act on that one.
string|false The overridden $conf_path, or FALSE if the $conf_path should not currently be overridden.
function _drupal_simpletest_conf_path() {
// Ensure that the settings object is available. conf_path() is called once
// before the Settings class is included, and at that point it should still
// load the primary $conf_path. See drupal_settings_initialize().
if (!class_exists('Drupal\\Component\\Utility\\Settings', FALSE)) {
return FALSE;
}
// If no $simpletest_conf_path is set, use the normal $conf_path.
if (!($simpletest_conf_path = settings()
->get('simpletest_conf_path'))) {
return FALSE;
}
// Ensure that this is actually a simpletest request. We can't check this
// before settings.php is loaded.
if (!drupal_valid_test_ua()) {
return FALSE;
}
// When the $simpletest_conf_path is set in a valid test request,
// return that path.
return $simpletest_conf_path;
}