diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-08 05:28:30 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-08 05:28:30 +0000 |
commit | 17d30dc3a37c9eb524d601a34004efc92322d984 (patch) | |
tree | 358b7a174bddabb28856dfb2063b496561f253be /modules/simpletest | |
parent | 44c2bfdcd1ec8e309ad05c2d681d5d3755adecea (diff) | |
download | brdo-17d30dc3a37c9eb524d601a34004efc92322d984.tar.gz brdo-17d30dc3a37c9eb524d601a34004efc92322d984.tar.bz2 |
#925778 by mradcliffe, chx, sun, manarth: Fixed user edit title incorrectly shows currently logged in user.
Diffstat (limited to 'modules/simpletest')
-rw-r--r-- | modules/simpletest/tests/menu.test | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/modules/simpletest/tests/menu.test b/modules/simpletest/tests/menu.test index f95634807..e615f4b8d 100644 --- a/modules/simpletest/tests/menu.test +++ b/modules/simpletest/tests/menu.test @@ -872,19 +872,50 @@ class MenuBreadcrumbTestCase extends DrupalWebTestCase { // Verify breadcrumb on front page. $this->assertBreadcrumb('<front>', array()); + // Verify breadcrumb on user pages (without menu link) for anonymous user. $trail = $home; $this->assertBreadcrumb('user', $trail, t('User account')); $this->assertBreadcrumb('user/' . $this->admin_user->uid, $trail, $this->admin_user->name); + // Verify breadcrumb on user pages (without menu link) for registered users. $this->drupalLogin($this->admin_user); + $trail = $home; + $this->assertBreadcrumb('user', $trail, $this->admin_user->name); + $this->assertBreadcrumb('user/' . $this->admin_user->uid, $trail, $this->admin_user->name); $trail += array( 'user/' . $this->admin_user->uid => $this->admin_user->name, ); $this->assertBreadcrumb('user/' . $this->admin_user->uid . '/edit', $trail, $this->admin_user->name); + // Create a second user to verify breadcrumb on user pages again. + $this->web_user = $this->drupalCreateUser(array( + 'administer users', + 'access user profiles', + )); + $this->drupalLogin($this->web_user); + + // Verify correct breadcrumb and page title on another user's account pages + // (without menu link). + $trail = $home; + $this->assertBreadcrumb('user/' . $this->admin_user->uid, $trail, $this->admin_user->name); + $trail += array( + 'user/' . $this->admin_user->uid => $this->admin_user->name, + ); + $this->assertBreadcrumb('user/' . $this->admin_user->uid . '/edit', $trail, $this->admin_user->name); + + // Verify correct breadcrumb and page title when viewing own user account + // pages (without menu link). + $trail = $home; + $this->assertBreadcrumb('user/' . $this->web_user->uid, $trail, $this->web_user->name); + $trail += array( + 'user/' . $this->web_user->uid => $this->web_user->name, + ); + $this->assertBreadcrumb('user/' . $this->web_user->uid . '/edit', $trail, $this->web_user->name); + // Add a Navigation menu links for 'user' and $this->admin_user. // Although it may be faster to manage these links via low-level API // functions, there's a lot that can go wrong in doing so. + $this->drupalLogin($this->admin_user); $edit = array( 'link_title' => 'User', 'link_path' => 'user', |