Skip to:
Content

BuddyPress.org

Changeset 7045


Ignore:
Timestamp:
05/09/2013 01:32:48 PM (12 years ago)
Author:
boonebgorges
Message:

In test_bp_has_members_friendship_requests(), make current user super admin before redirecting

This test involves rerouting to a user's friendship request page, which is only
visible to that user and to bp_moderate users. This set of tests is run as an
'administrator' user, which does not have the bp_moderate cap on multisite
installations, so we need to grant super admin priviliges to avoid failures
when attempting to load the user's requests page.

In theory, we should be able to set the current user to the owner of the
requests page. I ran into problems doing this, which appear to be related to
the way that our test suite's go_to() method tears down and sets up current
user data. This should be fixed for real in the future. This changeset is a
workaround until then.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/testcases/members/template.php

    r7044 r7045  
    2020    }
    2121
    22     public function test_bp_user_query_include_on_user_page() {
     22    public function test_bp_has_members_include_on_user_page() {
    2323        $u1 = $this->create_user();
    2424        $u2 = $this->create_user();
     
    4141    }
    4242
    43     public function test_bp_user_query_friendship_requests() {
     43    public function test_bp_has_members_friendship_requests() {
    4444        $u1 = $this->create_user();
    4545        $u2 = $this->create_user();
     
    4747        friends_add_friend( $u1, $u2 );
    4848
     49        $this->grant_super_admin( get_current_user_id() );
    4950        $this->go_to( bp_core_get_user_domain( $u2 ) . bp_get_friends_slug() . '/requests/' );
     51        $this->restore_admins();
    5052
    5153        global $members_template;
Note: See TracChangeset for help on using the changeset viewer.