function FileDirectoryTest::testFileDirectoryTemp
7.x file.test | FileDirectoryTest::testFileDirectoryTemp() |
Ensure that the file_directory_temp() function always returns a value.
File
- drupal-7.x/
modules/ simpletest/ tests/ file.test, line 1015 - This provides SimpleTests for the core file handling functionality. These include FileValidateTest and FileSaveTest.
Class
- FileDirectoryTest
- Directory related tests.
Code
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, 'file_directory_temp() returned a non-empty value.');
$setting = variable_get('file_temporary_path', '');
$this->assertEqual($setting, $tmp_directory, "The 'file_temporary_path' variable has the same value that file_directory_temp() returned.");
}