Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/27/2024 04:30:23 PM (2 years ago)
Author:
espellcaste
Message:

Unit Tests: Conducted a thorough review of existing unit tests files and improved them to ensure robustness.

Props imath.

Closes ​https://github.com/buddypress/buddypress/pull/295
Fixes #9081

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/groups/template/bpGroupStatusMessage.php

    r13314 r13980  
    1212                parent::set_up();
    1313                $this->current_user = bp_loggedin_user_id();
    14                 $this->set_current_user( 0 );
     14                self::set_current_user( 0 );
    1515
    1616                if ( isset( $GLOBALS['groups_template'] ) ) {
    … …  
    2020
    2121        public function tear_down() {
    22                 $this->set_current_user( $this->current_user );
     22                self::set_current_user( $this->current_user );
    2323                if ( $this->groups_template ) {
    2424                        $GLOBALS['groups_template'] = $this->groups_template;
    … …  
    3535                $g = self::factory()->group->create( array( 'status' => 'private' ) );
    3636
    37                 $this->set_current_user( $users[0] );
     37                self::set_current_user( $users[0] );
    3838
    3939                groups_invite_user( array(
    … …  
    6161                $g = self::factory()->group->create( array( 'status' => 'private' ) );
    6262
    63                 $this->set_current_user( $u );
     63                self::set_current_user( $u );
    6464
    6565                if ( bp_has_groups( array( 'include' => array( $g ) ) ) ) {
    … …  
    9898                $g = self::factory()->group->create( array( 'status' => 'private' ) );
    9999
    100                 $this->set_current_user( $u );
     100                self::set_current_user( $u );
    101101
    102102                groups_send_membership_request( array(
    … …  
    123123                $g = self::factory()->group->create( array( 'status' => 'hidden' ) );
    124124
    125                 $this->set_current_user( $u );
     125                self::set_current_user( $u );
    126126
    127127                $group = groups_get_group( $g );
    … …  
    140140                $groups = self::factory()->group->create_many( 2, array( 'status' => 'private' ) );
    141141
    142                 $this->set_current_user( $u );
     142                self::set_current_user( $u );
    143143
    144144                // Fake the current group.
Note: See TracChangeset for help on using the changeset viewer.