diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2011-11-24 14:16:19 -0800 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2011-11-24 14:16:19 -0800 |
commit | f702fccca3d954d887767801407886cf3e7ad0cc (patch) | |
tree | eccef3178fbface95f7a515947b8644ef077c0d6 /modules/node | |
parent | c1b5616cc236c7a65569e1fad039e62e64bfab6a (diff) | |
download | brdo-f702fccca3d954d887767801407886cf3e7ad0cc.tar.gz brdo-f702fccca3d954d887767801407886cf3e7ad0cc.tar.bz2 |
Issue #1318316 by xjm: AssertTaxonomyPage is missing documentation.
Diffstat (limited to 'modules/node')
-rw-r--r-- | modules/node/node.test | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/modules/node/node.test b/modules/node/node.test index 6c3a678d5..96b93cf4a 100644 --- a/modules/node/node.test +++ b/modules/node/node.test @@ -1088,7 +1088,15 @@ class NodeAccessBaseTableTestCase extends DrupalWebTestCase { $this->assertTaxonomyPage(TRUE); } - protected function assertTaxonomyPage($super) { + /** + * Checks taxonomy/term listings to ensure only accessible nodes are listed. + * + * @param $is_admin + * A boolean indicating whether the current user is an administrator. If + * TRUE, all nodes should be listed. If FALSE, only public nodes and the + * user's own private nodes should be listed. + */ + protected function assertTaxonomyPage($is_admin) { foreach (array($this->publicTid, $this->privateTid) as $tid_is_private => $tid) { $this->drupalGet("taxonomy/term/$tid"); $this->nids_visible = array(); @@ -1101,8 +1109,9 @@ class NodeAccessBaseTableTestCase extends DrupalWebTestCase { // Private nodes should be visible on the private term page, // public nodes should be visible on the public term page. $should_be_visible = $tid_is_private == $is_private; - // Non-superusers on the private page can only see their own nodes. - if (!$super && $tid_is_private) { + // Non-administrators can only see their own nodes on the private + // term page. + if (!$is_admin && $tid_is_private) { $should_be_visible = $should_be_visible && $uid == $this->webUser->uid; } $this->assertIdentical(isset($this->nids_visible[$nid]), $should_be_visible, strtr('A %private node by user %uid is %visible for user %current_uid on the %tid_is_private page.', array( |