diff options
author | David Rothstein <drothstein@gmail.com> | 2015-08-19 17:20:31 -0400 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2015-08-19 17:20:31 -0400 |
commit | be00a1ced4104d84df2f34b149b35fb0adf91093 (patch) | |
tree | 57eb4bdd551ef892671c5d7d653a78fdd3f3d454 /modules/file/tests/file.test | |
parent | 5cb79b4b217e9aa315d61284398cce132c28bea4 (diff) | |
download | brdo-be00a1ced4104d84df2f34b149b35fb0adf91093.tar.gz brdo-be00a1ced4104d84df2f34b149b35fb0adf91093.tar.bz2 |
Drupal 7.39
Diffstat (limited to 'modules/file/tests/file.test')
-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)); |