Skip to:
Content

BuddyPress.org

Changeset 7186


Ignore:
Timestamp:
06/07/2013 04:12:14 AM (12 years ago)
Author:
boonebgorges
Message:

In test_bp_has_members_friendship_requests(), make sure current user is the owner of the profile page being visited

THis prevents unauthorized redirects, which throw PHP errors in PHPUnit along
the lines of "headers already sent".

File:
1 edited

Legend:

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

    r7045 r7186  
    4747        friends_add_friend( $u1, $u2 );
    4848
    49         $this->grant_super_admin( get_current_user_id() );
     49        $old_user = get_current_user_id();
     50        $this->set_current_user( $u2 );
     51
    5052        $this->go_to( bp_core_get_user_domain( $u2 ) . bp_get_friends_slug() . '/requests/' );
    5153        $this->restore_admins();
     
    5961        $request_ids = wp_list_pluck( $requests, 'ID' );
    6062        $this->assertEquals( $request_ids, array( $u1 ) );
     63
     64        $this->set_current_user( $old_user );
    6165    }
    6266
Note: See TracChangeset for help on using the changeset viewer.