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/messages/notifications.php

    r13414 r13980  
    88class BP_Tests_Messages_Notifications extends BP_UnitTestCase {
    99
     10        protected $reset_user_id = 0;
    1011        protected $filter_fired;
    1112
    … …  
    1415
    1516                $this->reset_user_id = get_current_user_id();
    16 
    1717                $this->filter_fired = '';
    1818        }
    1919
    2020        public function tear_down() {
     21                self::set_current_user( $this->reset_user_id );
     22
    2123                parent::tear_down();
    22 
    23                 $this->set_current_user( $this->reset_user_id );
    2424        }
    2525
    … …  
    3131                $t = 12;
    3232                $u = self::factory()->user->create();
    33                 $this->set_current_user( $u );
     33                self::set_current_user( $u );
    3434
    3535                // Admin
    … …  
    5555                $t = 12;
    5656                $u = self::factory()->user->create();
    57                 $this->set_current_user( $u );
     57                self::set_current_user( $u );
    5858
    5959                // Admin
    … …  
    7979                $t = 12;
    8080                $u = self::factory()->user->create();
    81                 $this->set_current_user( $u );
     81                self::set_current_user( $u );
    8282
    8383                // Admin
    … …  
    103103                $t = 12;
    104104                $u = self::factory()->user->create();
    105                 $this->set_current_user( $u );
     105                self::set_current_user( $u );
    106106
    107107                // Admin
    … …  
    189189                );
    190190
    191                 $this->set_current_user( $u1 );
     191                self::set_current_user( $u1 );
    192192
    193193                // Mark a thread read.
Note: See TracChangeset for help on using the changeset viewer.