? .DS_Store
? .cache
? .cvsignore
? .git
? .project
? .settings
? hook_file_10.patch
? test
? modules/.DS_Store
? modules/simpletest/.DS_Store
? sites/all/modules
? sites/default/files
? sites/default/settings.php
? sites/default/test
Index: modules/upload/upload.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.test,v
retrieving revision 1.4
diff -u -p -r1.4 upload.test
--- modules/upload/upload.test	15 Sep 2008 09:28:50 -0000	1.4
+++ modules/upload/upload.test	27 Sep 2008 23:17:22 -0000
@@ -100,16 +100,23 @@ class UploadTestCase extends DrupalWebTe
     $this->drupalLogin($web_user);
 
     $node = $this->drupalCreateNode();
-    $text_files = $this->drupalGetTestFiles('text');
-    $html_files = $this->drupalGetTestFiles('html');
-    $files = array(current($text_files)->filename, current($html_files)->filename);
-
-    // Attempt to upload .txt file when .test is only extension allowed.
-    $this->uploadFile($node, $files[0], FALSE);
-    $this->assertRaw(t('The specified file %name could not be uploaded. Only files with the following extensions are allowed: %files-allowed.', array('%name' => basename($files[0]), '%files-allowed' => $settings['upload_extensions'])), 'File '. $files[0] . ' was not allowed to be uploaded');
 
-    // Attempt to upload .test file when .test is only extension allowed.
-    $this->uploadFile($node, $files[1]);
+    // Attempt to upload .txt file when .html is only extension allowed.
+    $text_files = array_values($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->assertRaw(t('The specified file %name could not be uploaded.', array('%name' => basename($text_file))), 'File '. $text_file . ' was not allowed to be uploaded');
+    $this->assertRaw(t('Only files with the following extensions are allowed: %files-allowed.', array('%files-allowed' => $settings['upload_extensions'])), 'File '. $text_file . ' failed due to extension');
+
+    // Attempt to upload .html file when .html is only extension allowed.
+    $html_files = array_values($this->drupalGetTestFiles('html'));
+    // Use the HTML file with the .html extension, $html_files[0] has a .txt
+    // extension.
+    $html_file = $html_files[1]->filename;
+    $this->uploadFile($node, $html_file);
+    $this->assertNoRaw(t('The specified file %name could not be uploaded.', array('%name' => basename($html_file))), 'File '. $html_file . ' was allowed to be uploaded');
   }
 
   /**
