summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngie Byron2009-12-25 10:24:29 (GMT)
committerAngie Byron2009-12-25 10:24:29 (GMT)
commitb8f20997324150516360cca1345fbda70861bb47 (patch)
treeca6e8e85ac232db8c7a7be54a1de9dd7b384c3cd
parentc19b7667ae72c9ae78095003ab8325ab9bd5142b (diff)
#667410 by justinrandell: Fixed simpletest doesn't create a temporary files directory.
-rw-r--r--modules/simpletest/drupal_web_test_case.php3
-rw-r--r--modules/simpletest/tests/file.test2
2 files changed, 4 insertions, 1 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index 2f5c5b0..eb18ef4 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -1082,10 +1082,12 @@ class DrupalWebTestCase extends DrupalTestCase {
// 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 @@ class DrupalWebTestCase extends DrupalTestCase {
// 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'));
diff --git a/modules/simpletest/tests/file.test b/modules/simpletest/tests/file.test
index 051d578..0644d39 100644
--- a/modules/simpletest/tests/file.test
+++ b/modules/simpletest/tests/file.test
@@ -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');