diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-05-27 02:21:53 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-05-27 02:21:53 +0000 |
commit | 827e278489e55a294150524feb118bedfa6f2e92 (patch) | |
tree | 64e5daba9b1c9139e060e3e171dd852bb895f68a /modules/system/system.test | |
parent | e8364f5156decde5b6d5c9f79dbe01910c39a89a (diff) | |
download | brdo-827e278489e55a294150524feb118bedfa6f2e92.tar.gz brdo-827e278489e55a294150524feb118bedfa6f2e92.tar.bz2 |
#296693 by Damien Tournoud, boombatower, sun, and Xano: Hide parent administrative menu items when user has no access to any of their children.
Diffstat (limited to 'modules/system/system.test')
-rw-r--r-- | modules/system/system.test | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/system/system.test b/modules/system/system.test index e49b26e5d..9756e9738 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -370,6 +370,10 @@ class CronRunTestCase extends DrupalWebTestCase { } } + +/** + * Test administration pages and categories. + */ class AdminOverviewTestCase extends DrupalWebTestCase { /** * Implementation of getInfo(). @@ -435,6 +439,26 @@ class AdminOverviewTestCase extends DrupalWebTestCase { $this->assertFalse($extra, t('No extra panels found.')); } } + + /** + * Test administrative menu categories. + */ + public function testHideEmptyCategories() { + $user = $this->drupalCreateUser(array('administer nodes', 'access administration pages')); + $this->drupalLogin($user); + + $this->drupalGet('admin'); + + // Make sure menu items with children are displayed. + $this->assertLink(t('Administer')); + $this->assertLink(t('Content management')); + + // Make sure menu items without children are hidden. + $this->assertNoLink(t('Site building')); + $this->assertNoLink(t('Site configuration')); + $this->assertNoLink(t('User management')); + $this->assertNoLink(t('Reports')); + } } class AdminMetaTagTestCase extends DrupalWebTestCase { |