Révision 08f5d39b
Ajouté par Assos Assos il y a environ 9 ans
drupal7/modules/file/tests/file.test | ||
---|---|---|
377 | 377 |
$this->drupalPost($path, array(), t('Save')); |
378 | 378 |
$this->assertRaw(t('The file id is %fid.', array('%fid' => 0)), 'Submitted without a file.'); |
379 | 379 |
|
380 |
// Submit with a file, but with an invalid form token. Ensure the file |
|
381 |
// was not saved. |
|
382 |
$last_fid_prior = $this->getLastFileId(); |
|
383 |
$edit = array( |
|
384 |
'files[' . $input_base_name . ']' => drupal_realpath($test_file->uri), |
|
385 |
'form_token' => 'invalid token', |
|
386 |
); |
|
387 |
$this->drupalPost($path, $edit, t('Save')); |
|
388 |
$this->assertText('The form has become outdated. Copy any unsaved work in the form below'); |
|
389 |
$last_fid = $this->getLastFileId(); |
|
390 |
$this->assertEqual($last_fid_prior, $last_fid, 'File was not saved when uploaded with an invalid form token.'); |
|
391 |
|
|
380 | 392 |
// Submit a new file, without using the Upload button. |
381 | 393 |
$last_fid_prior = $this->getLastFileId(); |
382 | 394 |
$edit = array('files[' . $input_base_name . ']' => drupal_realpath($test_file->uri)); |
Formats disponibles : Unified diff
Update drupal 7.38 -> 7.39