Some tests such as those for file uploads use the tempory:// URI. However, we don't set a testing temp directory, so test results may be incorrect if a previously saved file still exists.
Also, we shoudl double-check this code in the tests setUp() mehtod, since it looks a little odd still:
// Use temporary files directory with the same prefix as the database.
$public_files_directory = $this->originalFileDirectory . '/' . $db_prefix;
$private_files_directory = $public_files_directory . '/private';
// Set path variables
variable_set('file_public_path', $public_files_directory);
variable_set('file_private_path', $private_files_directory);
// Create the directories
$directory = file_directory_path('public');
file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
file_prepare_directory($private_files_directory, FILE_CREATE_DIRECTORY);
Comments
Comment #1
c960657 commentedA fix is included in the patch for #616162: Simpletest leaves files behind.
Comment #2
bleen commentedthis is being handled here: #577398: Ensure test coverage of simpletest temporary file handling