summaryrefslogtreecommitdiff
path: root/modules/upload/upload.test
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2008-10-12 08:30:05 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2008-10-12 08:30:05 +0000
commitf95f58cc056a5d83df01c59f63dbdbb0bc7767b3 (patch)
tree542bbd301cdf5aa574b594a3e517aee96cc307bd /modules/upload/upload.test
parentbc22653541bba1be497c4ff8bdb199e61debd466 (diff)
downloadbrdo-f95f58cc056a5d83df01c59f63dbdbb0bc7767b3.tar.gz
brdo-f95f58cc056a5d83df01c59f63dbdbb0bc7767b3.tar.bz2
#320161 by Dave Reid: Fix problems with drupalGetTestFiles() that causes upload.test to break on some systems.
Diffstat (limited to 'modules/upload/upload.test')
-rw-r--r--modules/upload/upload.test7
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/upload/upload.test b/modules/upload/upload.test
index 1b1400021..a1f05757e 100644
--- a/modules/upload/upload.test
+++ b/modules/upload/upload.test
@@ -102,14 +102,13 @@ class UploadTestCase extends DrupalWebTestCase {
$node = $this->drupalCreateNode();
// Attempt to upload .txt file when .html is only extension allowed.
- $text_files = array_values($this->drupalGetTestFiles('text'));
+ $text_file = current($this->drupalGetTestFiles('text'));
// Select a file that's less than the 1MB upload limit so we only test one
// limit at a time.
- $text_file = $text_files[2]->filename;
- $this->uploadFile($node, $text_file, FALSE);
+ $this->uploadFile($node, $text_file->filename, FALSE);
// Test the error message in two steps in case there are additional errors
// that change the error message's format.
- $this->assertRaw(t('The specified file %name could not be uploaded.', array('%name' => basename($text_file))), t('File %filename was not allowed to be uploaded', array('%filename' => $text_file)));
+ $this->assertRaw(t('The specified file %name could not be uploaded.', array('%name' => $text_file->basename)), t('File %filename was not allowed to be uploaded', array('%filename' => $text_file->filename)));
$this->assertRaw(t('Only files with the following extensions are allowed: %files-allowed.', array('%files-allowed' => $settings['upload_extensions'])), t('File extension cited as reason for failure'));
// Attempt to upload .html file when .html is only extension allowed.