From f95f58cc056a5d83df01c59f63dbdbb0bc7767b3 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sun, 12 Oct 2008 08:30:05 +0000 Subject: #320161 by Dave Reid: Fix problems with drupalGetTestFiles() that causes upload.test to break on some systems. --- modules/upload/upload.test | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'modules/upload/upload.test') 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. -- cgit v1.2.3