summaryrefslogtreecommitdiff
path: root/modules/file/tests
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2014-07-16 16:03:02 -0400
committerDavid Rothstein <drothstein@gmail.com>2014-07-16 16:03:02 -0400
commit83b80acad8431fcd56e9a331ba06c41edee48c91 (patch)
tree14e68546a7d96f64ea9e34196f10404eea093922 /modules/file/tests
parent1769d1cca92e206510528c324552797e83a1fc7c (diff)
downloadbrdo-83b80acad8431fcd56e9a331ba06c41edee48c91.tar.gz
brdo-83b80acad8431fcd56e9a331ba06c41edee48c91.tar.bz2
Drupal 7.29
Diffstat (limited to 'modules/file/tests')
-rw-r--r--modules/file/tests/file.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/file/tests/file.test b/modules/file/tests/file.test
index 69e711a36..4d53d747f 100644
--- a/modules/file/tests/file.test
+++ b/modules/file/tests/file.test
@@ -1167,5 +1167,18 @@ class FilePrivateTestCase extends FileFieldTestCase {
// Ensure the file cannot be downloaded.
$this->drupalGet(file_create_url($node_file->uri));
$this->assertResponse(403, 'Confirmed that access is denied for the file without view field access permission.');
+
+ // Attempt to reuse the existing file when creating a new node, and confirm
+ // that access is still denied.
+ $edit = array();
+ $edit['title'] = $this->randomName(8);
+ $edit[$field_name . '[' . LANGUAGE_NONE . '][0][fid]'] = $node_file->fid;
+ $this->drupalPost('node/add/page', $edit, t('Save'));
+ $new_node = $this->drupalGetNodeByTitle($edit['title']);
+ $this->assertTrue(!empty($new_node), 'Node was created.');
+ $this->assertUrl('node/' . $new_node->nid);
+ $this->assertNoRaw($node_file->filename, 'File without view field access permission does not appear after attempting to attach it to a new node.');
+ $this->drupalGet(file_create_url($node_file->uri));
+ $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.');
}
}