summaryrefslogtreecommitdiff
path: root/modules/file
diff options
context:
space:
mode:
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 ea8c5c67b..044c6f698 100644
--- a/modules/file/tests/file.test
+++ b/modules/file/tests/file.test
@@ -530,6 +530,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');
@@ -559,6 +560,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.'));
}
}