- Timestamp:
- 11/03/2024 06:19:06 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/activity/notifications.php
r13980 r14070 20 20 $this->u1 = self::factory()->user->create(); 21 21 $this->u2 = self::factory()->user->create(); 22 self::set_current_user( $this->u1 );22 wp_set_current_user( $this->u1 ); 23 23 24 24 /** … … 32 32 33 33 public function tear_down() { 34 self::set_current_user( $this->current_user );34 wp_set_current_user( $this->current_user ); 35 35 $this->set_permalink_structure( $this->permalink_structure ); 36 36 … … 90 90 91 91 // Log out 92 self::set_current_user( 0 );92 wp_set_current_user( 0 ); 93 93 94 94 // Go to the activity permalink page … … 110 110 $this->assertEquals( array( $this->a1 ), wp_list_pluck( $notifications, 'item_id' ) ); 111 111 112 self::set_current_user( $this->u1 );112 wp_set_current_user( $this->u1 ); 113 113 } 114 114 … … 129 129 130 130 // Switch user 131 self::set_current_user( $this->u2 );131 wp_set_current_user( $this->u2 ); 132 132 133 133 // Go to the activity permalink page … … 149 149 $this->assertEquals( array( $this->a1 ), wp_list_pluck( $notifications, 'item_id' ) ); 150 150 151 self::set_current_user( $this->u1 );151 wp_set_current_user( $this->u1 ); 152 152 } 153 153 … … 202 202 203 203 // Log out 204 self::set_current_user( 0 );204 wp_set_current_user( 0 ); 205 205 206 206 // Go to the My Activity page … … 223 223 224 224 // clean up 225 self::set_current_user( $this->u1 );225 wp_set_current_user( $this->u1 ); 226 226 } 227 227 … … 242 242 243 243 // Log out 244 self::set_current_user( $this->u2 );244 wp_set_current_user( $this->u2 ); 245 245 246 246 // Go to the My Activity page … … 263 263 264 264 // clean up 265 self::set_current_user( $this->u1 );265 wp_set_current_user( $this->u1 ); 266 266 } 267 267 … … 444 444 445 445 // Attempt to mark 'comment_reply' notifications as read for user 2. 446 self::set_current_user( $this->u2 );446 wp_set_current_user( $this->u2 ); 447 447 foreach ( $u2_notifications as $i => $n ) { 448 448 $n = bp_activity_format_notifications( $n->component_action, $n->item_id, $n->secondary_item_id, 1, 'array', $n->id ); … … 471 471 $u3 = self::factory()->user->create(); 472 472 473 self::set_current_user( $u1 );473 wp_set_current_user( $u1 ); 474 474 $userdata = get_userdata( $u1 ); 475 475 … … 487 487 ) ); 488 488 489 self::set_current_user( $u2 );489 wp_set_current_user( $u2 ); 490 490 $userdata = get_userdata( $u2 ); 491 491 … … 503 503 self::factory()->comment->update_object( $c1, array( 'comment_approved' => 1 ) ); 504 504 505 self::set_current_user( $u3 );505 wp_set_current_user( $u3 ); 506 506 $userdata = get_userdata( $u3 ); 507 507 … … 543 543 544 544 // Reset. 545 self::set_current_user( $old_user );545 wp_set_current_user( $old_user ); 546 546 remove_filter( 'bp_disable_blogforum_comments', '__return_false' ); 547 547 remove_filter( 'comment_flood_filter', '__return_false' );
Note: See TracChangeset
for help on using the changeset viewer.