summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-10-05 06:23:18 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-10-05 06:23:18 +0000
commit57759f5a8ddc85231ea2ab61d707a062dbaae000 (patch)
tree849acaa84a6cf72bcc0f84bf7fe96c8a54e93046 /modules
parent5d76008993fc7edc5d4c1aedba8af81b36d1554e (diff)
downloadbrdo-57759f5a8ddc85231ea2ab61d707a062dbaae000.tar.gz
brdo-57759f5a8ddc85231ea2ab61d707a062dbaae000.tar.bz2
#930122 by dww: Regression: temp directory handling broken by confusion between file_directory_temp and file_temporary_path.
Diffstat (limited to 'modules')
-rw-r--r--modules/simpletest/tests/file.test13
-rw-r--r--modules/system/system.module7
2 files changed, 16 insertions, 4 deletions
diff --git a/modules/simpletest/tests/file.test b/modules/simpletest/tests/file.test
index 94a65938e..36a7170b2 100644
--- a/modules/simpletest/tests/file.test
+++ b/modules/simpletest/tests/file.test
@@ -972,8 +972,19 @@ class FileDirectoryTest extends FileTestCase {
$path = file_destination($destination, FILE_EXISTS_ERROR);
$this->assertEqual($path, FALSE, t('An error is returned when filepath destination already exists with FILE_EXISTS_ERROR.'), 'File');
}
-}
+ /**
+ * Ensure that the file_directory_temp() function always returns a value.
+ */
+ function testFileDirectoryTemp() {
+ // Start with an empty variable to ensure we have a clean slate.
+ variable_set('file_temporary_path', '');
+ $tmp_directory = file_directory_temp();
+ $this->assertEqual(empty($tmp_directory), FALSE, t('file_directory_temp() returned a non-empty value.'));
+ $setting = variable_get('file_temporary_path', '');
+ $this->assertEqual($setting, $tmp_directory, t("The 'file_temporary_path' variable has the same value that file_directory_temp() returned."));
+ }
+}
/**
* Tests the file_scan_directory() function.
diff --git a/modules/system/system.module b/modules/system/system.module
index bfbdc285c..08d2010cc 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -2069,9 +2069,10 @@ function system_admin_menu_block($item) {
}
/**
- * Checks the existence of the directory specified in $form_element. This
- * function is called from the system_settings form to check both core file
- * directories (file_public_path, file_private_path, file_temporary_path).
+ * Checks the existence of the directory specified in $form_element.
+ *
+ * This function is called from the system_settings form to check all core
+ * file directories (file_public_path, file_private_path, file_temporary_path).
*
* @param $form_element
* The form element containing the name of the directory to check.