From b38a806c16a0209e111aa832b8dc12fded1471ce Mon Sep 17 00:00:00 2001 From: webchick Date: Wed, 27 Jul 2011 13:16:17 -0700 Subject: Drupal 7.5 --- modules/file/tests/file.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'modules/file/tests') 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.')); } } -- cgit v1.2.3