Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/10/2015 02:49:16 AM (10 years ago)
Author:
johnjamesjacoby
Message:

Replace all remaining $bp global touches with buddypress().

All existing tests continue to pass as normal. I will further manually scrutinize each replacement to ensure correctness.

Fixes #5138. Any stragglers or updates will reference this ticket.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/members/functions.php

    r9398 r9471  
    172172     */
    173173    public function test_bp_core_get_user_displayname_xprofile_does_not_exist() {
     174        $bp = buddypress();
    174175        $xprofile_is_active = bp_is_active( 'xprofile' );
    175         buddypress()->active_components['xprofile'] = '1';
     176        $bp->active_components['xprofile'] = '1';
    176177
    177178        $u = $this->factory->user->create( array(
     
    181182        // Delete directly because BP won't let you delete a required
    182183        // field through the API
    183         global $wpdb, $bp;
     184        global $wpdb;
    184185        $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE user_id = %d AND field_id = 1", $u ) );
    185186        wp_cache_delete( 'bp_user_fullname_' . $u, 'bp' );
     
    191192
    192193        if ( ! $xprofile_is_active ) {
    193             unset( buddypress()->active_components['xprofile'] );
     194            unset( $bp->active_components['xprofile'] );
    194195        }
    195196    }
     
    233234        // Delete directly because BP won't let you delete a required
    234235        // field through the API
    235         global $wpdb, $bp;
     236        global $wpdb;
     237        $bp = buddypress();
    236238        $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE user_id = %d AND field_id = 1", $u2 ) );
    237239        wp_cache_delete( 'bp_user_fullname_' . $u2, 'bp' );
     
    378380
    379381        // Create an existing entry in last_activity to test no dupes
    380         global $wpdb, $bp;
     382        global $wpdb;
     383        $bp = buddypress();
    381384        $wpdb->query( $wpdb->prepare(
    382385            "INSERT INTO {$bp->members->table_name_last_activity}
Note: See TracChangeset for help on using the changeset viewer.