Commit d2d67960 authored by webchick's avatar webchick

Issue #1791920 by c960657: Fixed Create new translations:// directory for tests.

parent 0c7b5d88
......@@ -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);
}
/**
......
......@@ -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);
}
/**
......
......@@ -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);
......
......@@ -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
......
......@@ -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.
......
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