summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
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.