From 57759f5a8ddc85231ea2ab61d707a062dbaae000 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Tue, 5 Oct 2010 06:23:18 +0000 Subject: #930122 by dww: Regression: temp directory handling broken by confusion between file_directory_temp and file_temporary_path. --- modules/simpletest/tests/file.test | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'modules/simpletest/tests') 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. -- cgit v1.2.3