summaryrefslogtreecommitdiff
path: root/modules/file
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-07-27 13:19:38 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2011-07-27 13:19:38 -0700
commit1f124bf1accbad60b31a463ff59232d2f5626100 (patch)
treee8e899b5f9a2ea559982fd6b5db7302e428c198f /modules/file
parentbdc2373eabb8729931032c007600ca69ab1c997f (diff)
parenteabb023933ac83947e5d238c4a83b1f5bdbcc738 (diff)
downloadbrdo-1f124bf1accbad60b31a463ff59232d2f5626100.tar.gz
brdo-1f124bf1accbad60b31a463ff59232d2f5626100.tar.bz2
Merge branch '7.4-security' into 7.x
Diffstat (limited to 'modules/file')
-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 d3d79bf9d..0e5f97d84 100644
--- a/modules/file/tests/file.test
+++ b/modules/file/tests/file.test
@@ -540,6 +540,7 @@ class FileFieldWidgetTestCase extends FileFieldTestCase {
'title' => $this->randomName(),
);
$this->drupalPost('node/add/article', $edit, t('Save'));
+ $node = $this->drupalGetNodeByTitle($edit['title']);
// Add a comment with a file.
$text_file = $this->getTestFile('text');
@@ -569,6 +570,18 @@ class FileFieldWidgetTestCase extends FileFieldTestCase {
$this->drupalLogout();
$this->drupalGet(file_create_url($comment_file->uri));
$this->assertResponse(403, t('Confirmed that access is denied for the file without the needed permission.'));
+
+ // Unpublishes node.
+ $this->drupalLogin($this->admin_user);
+ $edit = array(
+ 'status' => FALSE,
+ );
+ $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+
+ // Ensures normal user can no longer download the file.
+ $this->drupalLogin($user);
+ $this->drupalGet(file_create_url($comment_file->uri));
+ $this->assertResponse(403, t('Confirmed that access is denied for the file without the needed permission.'));
}
}