summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/simpletest/tests/file.test9
-rw-r--r--modules/simpletest/tests/file_test.module2
2 files changed, 9 insertions, 2 deletions
diff --git a/modules/simpletest/tests/file.test b/modules/simpletest/tests/file.test
index d5ca1d854..ae05be83d 100644
--- a/modules/simpletest/tests/file.test
+++ b/modules/simpletest/tests/file.test
@@ -599,6 +599,14 @@ class FileSaveUploadTest extends FileHookTestCase {
// Check that the no hooks were called while failing.
$this->assertFileHooksCalled(array());
}
+
+ /**
+ * Test for no failures when not uploading a file.
+ */
+ function testNoUpload() {
+ $this->drupalPost('file-test/upload', array(), t('Submit'));
+ $this->assertNoRaw(t('Epic upload FAIL!'), t('Failure message not found.'));
+ }
}
/**
@@ -1765,4 +1773,3 @@ class FileNameMungingTest extends FileTestCase {
$this->assertIdentical($unmunged_name, $this->name, t('The unmunged (%unmunged) filename matches the original (%original)', array('%unmunged' => $unmunged_name, '%original' => $this->name)));
}
}
-
diff --git a/modules/simpletest/tests/file_test.module b/modules/simpletest/tests/file_test.module
index 899bbdc43..9d44b40ab 100644
--- a/modules/simpletest/tests/file_test.module
+++ b/modules/simpletest/tests/file_test.module
@@ -61,7 +61,7 @@ function _file_test_form_submit(&$form, &$form_state) {
drupal_set_message(t('File @filepath was uploaded.', array('@filepath' => $file->filepath)));
drupal_set_message(t('You WIN!'));
}
- else {
+ elseif ($file === FALSE) {
drupal_set_message(t('Epic upload FAIL!'), 'error');
}
}