summaryrefslogtreecommitdiff
path: root/modules/file
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2015-08-19 17:22:37 -0400
committerDavid Rothstein <drothstein@gmail.com>2015-08-19 17:22:37 -0400
commit731dfacab8bf39918c135bf4939e56a76dc6ab34 (patch)
tree7febc850df6d6f4ebc82073376f4041c300abfb7 /modules/file
parent11cc2b0251d705b5bed981368fee038e5dddb0d1 (diff)
parentbe00a1ced4104d84df2f34b149b35fb0adf91093 (diff)
downloadbrdo-731dfacab8bf39918c135bf4939e56a76dc6ab34.tar.gz
brdo-731dfacab8bf39918c135bf4939e56a76dc6ab34.tar.bz2
Merge tag '7.39' into 7.x
7.39 release Conflicts: CHANGELOG.txt includes/bootstrap.inc
Diffstat (limited to 'modules/file')
-rw-r--r--modules/file/tests/file.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/file/tests/file.test b/modules/file/tests/file.test
index 33d7afd1b..5c19d001f 100644
--- a/modules/file/tests/file.test
+++ b/modules/file/tests/file.test
@@ -377,6 +377,18 @@ class FileManagedFileElementTestCase extends FileFieldTestCase {
$this->drupalPost($path, array(), t('Save'));
$this->assertRaw(t('The file id is %fid.', array('%fid' => 0)), 'Submitted without a file.');
+ // Submit with a file, but with an invalid form token. Ensure the file
+ // was not saved.
+ $last_fid_prior = $this->getLastFileId();
+ $edit = array(
+ 'files[' . $input_base_name . ']' => drupal_realpath($test_file->uri),
+ 'form_token' => 'invalid token',
+ );
+ $this->drupalPost($path, $edit, t('Save'));
+ $this->assertText('The form has become outdated. Copy any unsaved work in the form below');
+ $last_fid = $this->getLastFileId();
+ $this->assertEqual($last_fid_prior, $last_fid, 'File was not saved when uploaded with an invalid form token.');
+
// Submit a new file, without using the Upload button.
$last_fid_prior = $this->getLastFileId();
$edit = array('files[' . $input_base_name . ']' => drupal_realpath($test_file->uri));