Commit b8f20997 authored by webchick's avatar webchick

#667410 by justinrandell: Fixed simpletest doesn't create a temporary files directory.

parent c19b7667
......@@ -1082,10 +1082,12 @@ protected function setUp() {
// Use temporary files directory with the same prefix as the database.
$public_files_directory = $this->originalFileDirectory . '/simpletest/' . substr($db_prefix, 10);
$private_files_directory = $public_files_directory . '/private';
$temp_files_directory = $private_files_directory . '/temp';
// Create the directories
file_prepare_directory($public_files_directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
file_prepare_directory($private_files_directory, FILE_CREATE_DIRECTORY);
file_prepare_directory($temp_files_directory, FILE_CREATE_DIRECTORY);
// Log fatal errors.
ini_set('log_errors', 1);
......@@ -1150,6 +1152,7 @@ protected function setUp() {
// Set path variables
variable_set('file_public_path', $public_files_directory);
variable_set('file_private_path', $private_files_directory);
variable_set('file_temporary_path', $temp_files_directory);
// Use the test mail class instead of the default mail handler class.
variable_set('mail_system', array('default-system' => 'TestingMailSystem'));
......
......@@ -2195,7 +2195,7 @@ class StreamWrapperTest extends DrupalWebTestCase {
$this->assertEqual(file_build_uri('foo/bar.txt'), 'public://foo/bar.txt', t('Expected scheme was added.'));
$this->assertEqual(file_directory_path(), variable_get('file_public_path'), t('Expected default directory path was returned.'));
$this->assertEqual(file_directory_path('public'), variable_get('file_public_path'), t('Expected public directory path was returned.'));
$this->assertEqual(file_directory_path('temporary'), conf_path() . '/private/temp', t('Expected temporary directory path was returned.'));
$this->assertEqual(file_directory_path('temporary'), variable_get('file_temporary_path'), t('Expected temporary directory path was returned.'));
$this->assertEqual(file_directory_path($this->scheme), variable_get('stream_public_path', 'sites/default/files'), t('Expected dummy directory path was returned.'));
$this->assertFalse(file_directory_path('non-existent'), t('No directory path returned for invalid scheme.'));
variable_set('file_default_scheme', 'private');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment