diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleExportTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleExportTest.php index 6ea09bd85d3bcfb9f7e9fd0e54abcbd80b85cf42..7ae1bf7b7bac4dd66f586e1d088eea5787094bbe 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleExportTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleExportTest.php @@ -40,13 +40,9 @@ function setUp() { $this->admin_user = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages')); $this->drupalLogin($this->admin_user); - // Set the translation file directory to something writable. - $destination = 'translations://'; - file_prepare_directory($destination, FILE_CREATE_DIRECTORY); - - // Copy test po files to the same directory. - file_unmanaged_copy(drupal_get_path('module', 'locale') . '/tests/test.de.po', $destination, FILE_EXISTS_REPLACE); - file_unmanaged_copy(drupal_get_path('module', 'locale') . '/tests/test.xx.po', $destination, FILE_EXISTS_REPLACE); + // Copy test po files to the translations directory. + file_unmanaged_copy(drupal_get_path('module', 'locale') . '/tests/test.de.po', 'translations://', FILE_EXISTS_REPLACE); + file_unmanaged_copy(drupal_get_path('module', 'locale') . '/tests/test.xx.po', 'translations://', FILE_EXISTS_REPLACE); } /** diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleFileImportStatus.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleFileImportStatus.php index f3a0908761ce76c73ec0b9b0bf88a9cb2c3286bc..06d292f08c16bce62c364c549e8879ba31a42fd6 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleFileImportStatus.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleFileImportStatus.php @@ -35,13 +35,9 @@ function setUp() { $admin_user = $this->drupalCreateUser(array('administer site configuration', 'administer languages', 'access administration pages')); $this->drupalLogin($admin_user); - // Set the translation file directory to something writable. - $destination = 'translations://'; - file_prepare_directory($destination, FILE_CREATE_DIRECTORY); - - // Copy test po files to the same directory. - file_unmanaged_copy(drupal_get_path('module', 'locale') . '/tests/test.de.po', $destination, FILE_EXISTS_REPLACE); - file_unmanaged_copy(drupal_get_path('module', 'locale') . '/tests/test.xx.po', $destination, FILE_EXISTS_REPLACE); + // Copy test po files to the translations directory. + file_unmanaged_copy(drupal_get_path('module', 'locale') . '/tests/test.de.po', 'translations://', FILE_EXISTS_REPLACE); + file_unmanaged_copy(drupal_get_path('module', 'locale') . '/tests/test.xx.po', 'translations://', FILE_EXISTS_REPLACE); } /** diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php index 28521652cd987ff5421df8ee12ce11b217577f52..4dca9e73c7e5ca783829830935300a7f8e14ea8e 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php @@ -36,13 +36,10 @@ public static function getInfo() { function setUp() { parent::setUp(); - // Set the translation file directory to something writable. - $destination = 'translations://'; - file_prepare_directory($destination, FILE_CREATE_DIRECTORY); - // Copy test po files to the same directory. - file_unmanaged_copy(drupal_get_path('module', 'locale') . '/tests/test.de.po', $destination, FILE_EXISTS_REPLACE); - file_unmanaged_copy(drupal_get_path('module', 'locale') . '/tests/test.xx.po', $destination, FILE_EXISTS_REPLACE); + // Copy test po files to the translations directory. + file_unmanaged_copy(drupal_get_path('module', 'locale') . '/tests/test.de.po', 'translations://', FILE_EXISTS_REPLACE); + file_unmanaged_copy(drupal_get_path('module', 'locale') . '/tests/test.xx.po', 'translations://', FILE_EXISTS_REPLACE); $this->admin_user = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages')); $this->drupalLogin($this->admin_user); diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php index 0d29f848db1783fded5d7b51a77c75e1b7e8ee8f..637003324efb231650ba4215c2c9a43d0c8ba54f 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php @@ -725,11 +725,13 @@ protected function prepareEnvironment() { $this->public_files_directory = $this->originalFileDirectory . '/simpletest/' . substr($this->databasePrefix, 10); $this->private_files_directory = $this->public_files_directory . '/private'; $this->temp_files_directory = $this->private_files_directory . '/temp'; + $this->translation_files_directory = $this->public_files_directory . '/translations'; // Create the directories file_prepare_directory($this->public_files_directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS); file_prepare_directory($this->private_files_directory, FILE_CREATE_DIRECTORY); file_prepare_directory($this->temp_files_directory, FILE_CREATE_DIRECTORY); + file_prepare_directory($this->translation_files_directory, FILE_CREATE_DIRECTORY); $this->generatedTestFiles = FALSE; // Create and set new configuration directories. The child site diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index 5574679c52aab0746a38bcf838bc895d978ef496..20cc70bdc89371942172cc81e8ce10e380bbfb37 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -698,6 +698,7 @@ protected function setUp() { variable_set('file_public_path', $this->public_files_directory); variable_set('file_private_path', $this->private_files_directory); variable_set('file_temporary_path', $this->temp_files_directory); + variable_set('locale_translate_file_directory', $this->translation_files_directory); // Set 'parent_profile' of simpletest to add the parent profile's // search path to the child site's search paths.