Ticket #8251: 8251.diff
File 8251.diff, 2.0 KB (added by , 5 years ago) |
---|
-
testcase.php
60 60 61 61 $this->factory = new BP_UnitTest_Factory; 62 62 63 // Fixes warnings in multisite functions 63 // Fixes warnings in multisite functions. 64 64 $_SERVER['REMOTE_ADDR'] = ''; 65 65 global $wpdb; 66 66 … … 67 67 // Clean up after autocommits. 68 68 add_action( 'bp_blogs_recorded_existing_blogs', array( $this, 'set_autocommit_flag' ) ); 69 69 70 // Make sure Activity actions are reset before each test 70 // Make sure Activity actions are reset before each test. 71 71 $this->reset_bp_activity_actions(); 72 72 73 // Make sure all Post types activities globals are reset before each test 73 // Make sure all Post types activities globals are reset before each test. 74 74 $this->reset_bp_activity_post_types_globals(); 75 75 } 76 76 … … 205 205 /** 206 206 * WP's core tests use wp_set_current_user() to change the current 207 207 * user during tests. BP caches the current user differently, so we 208 * have to do a bit more work to change it 208 * have to do a bit more work to change it. 209 209 */ 210 210 public static function set_current_user( $user_id ) { 211 211 $bp = buddypress(); … … 248 248 /** 249 249 * We can't use grant_super_admin() because we will need to modify 250 250 * the list more than once, and grant_super_admin() can only be run 251 * once because of its global check 251 * once because of its global check. 252 252 */ 253 253 public function grant_super_admin( $user_id ) { 254 254 global $super_admins; … … 261 261 } 262 262 263 263 public function restore_admins() { 264 // We assume that the global can be wiped out 264 // We assume that the global can be wiped out. 265 265 // @see grant_super_admin() 266 266 unset( $GLOBALS['super_admins'] ); 267 267 } … … 343 343 * Clean up created directories/files 344 344 */ 345 345 public function rrmdir( $dir ) { 346 // Make sure we are only removing files/dir from uploads 346 // Make sure we are only removing files/dir from uploads. 347 347 if ( 0 !== strpos( $dir, bp_core_avatar_upload_path() ) ) { 348 348 return; 349 349 }