Révision f842d52a
Ajouté par Julien Enselme il y a presque 10 ans
drupal7/modules/file/tests/file.test | ||
---|---|---|
1167 | 1167 |
// Ensure the file cannot be downloaded. |
1168 | 1168 |
$this->drupalGet(file_create_url($node_file->uri)); |
1169 | 1169 |
$this->assertResponse(403, 'Confirmed that access is denied for the file without view field access permission.'); |
1170 |
|
|
1171 |
// Attempt to reuse the existing file when creating a new node, and confirm |
|
1172 |
// that access is still denied. |
|
1173 |
$edit = array(); |
|
1174 |
$edit['title'] = $this->randomName(8); |
|
1175 |
$edit[$field_name . '[' . LANGUAGE_NONE . '][0][fid]'] = $node_file->fid; |
|
1176 |
$this->drupalPost('node/add/page', $edit, t('Save')); |
|
1177 |
$new_node = $this->drupalGetNodeByTitle($edit['title']); |
|
1178 |
$this->assertTrue(!empty($new_node), 'Node was created.'); |
|
1179 |
$this->assertUrl('node/' . $new_node->nid); |
|
1180 |
$this->assertNoRaw($node_file->filename, 'File without view field access permission does not appear after attempting to attach it to a new node.'); |
|
1181 |
$this->drupalGet(file_create_url($node_file->uri)); |
|
1182 |
$this->assertResponse(403, 'Confirmed that access is denied for the file without view field access permission after attempting to attach it to a new node.'); |
|
1170 | 1183 |
} |
1171 | 1184 |
} |
Formats disponibles : Unified diff
Update to 7.28