diff options
author | David Rothstein <drothstein@gmail.com> | 2015-08-19 17:22:37 -0400 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2015-08-19 17:22:37 -0400 |
commit | 731dfacab8bf39918c135bf4939e56a76dc6ab34 (patch) | |
tree | 7febc850df6d6f4ebc82073376f4041c300abfb7 /modules/file | |
parent | 11cc2b0251d705b5bed981368fee038e5dddb0d1 (diff) | |
parent | be00a1ced4104d84df2f34b149b35fb0adf91093 (diff) | |
download | brdo-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.test | 12 |
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)); |