Commit 5e65498a authored by catch's avatar catch

Issue #1517138 by sun: Follow-up for SimpleTest does not create configuration...

Issue #1517138 by sun: Follow-up for SimpleTest does not create configuration folder causing test failures.
parent 121f7ee0
......@@ -17,8 +17,8 @@ function config_get_config_directory() {
global $config_directory_name;
if ($test_prefix = drupal_valid_test_ua()) {
$path = conf_path() . '/files/simpletest/config_' . $test_prefix;
file_prepare_directory($path, FILE_CREATE_DIRECTORY);
// @see DrupalWebTestCase::setUp()
$path = conf_path() . '/files/simpletest/' . substr($test_prefix, 10) . '/config';
}
else {
$path = conf_path() . '/files/' . $config_directory_name;
......
......@@ -1354,7 +1354,8 @@ protected function setUp() {
// Create and set a new configuration directory and signature key.
// The child site automatically adjusts the global $config_directory_name to
// a test-prefix-specific directory within the public files directory.
$GLOBALS['config_directory_name'] = 'simpletest/config_' . $this->databasePrefix;
// @see config_get_config_directory()
$GLOBALS['config_directory_name'] = 'simpletest/' . substr($this->databasePrefix, 10) . '/config';
$this->configFileDirectory = $this->originalFileDirectory . '/' . $GLOBALS['config_directory_name'];
file_prepare_directory($this->configFileDirectory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
$GLOBALS['config_signature_key'] = drupal_hash_base64(drupal_random_bytes(55));
......@@ -1547,9 +1548,6 @@ protected function tearDown() {
// Delete temporary files directory.
file_unmanaged_delete_recursive($this->originalFileDirectory . '/simpletest/' . substr($this->databasePrefix, 10));
// Delete temporary config files directory.
file_unmanaged_delete_recursive($this->originalFileDirectory . '/simpletest/config_simpletest' . substr($this->databasePrefix, 10));
// Remove all prefixed tables (all the tables in the schema).
$schema = drupal_get_schema(NULL, TRUE);
foreach ($schema as $name => $table) {
......
Markdown is supported
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