Skip to:
Content

BuddyPress.org

Changeset 12459


Ignore:
Timestamp:
09/16/2019 09:52:45 PM (14 months ago)
Author:
imath
Message:

Fix failing tests under WordPress trunk (5.3)

  1. Use do_action_ref_array() instead of do_action() to pass the BP_Friends_Friendship object by reference.
  2. Adapts the test_bp_has_members_search_pagination_with_spaces() test to WordPress changes in the paginate_links() function.

Fixes #8135

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-friends/classes/class-bp-friends-friendship.php

    r11865 r12459  
    198198         * @param BP_Friends_Friendship $value Current friendship request object.
    199199         */
    200         do_action( 'friends_friendship_after_save', array( &$this ) );
     200        do_action_ref_array( 'friends_friendship_after_save', array( &$this ) );
    201201
    202202        return $result;
     
    615615     * @since 3.0.0
    616616     *
    617      * @param int $user_id                          The ID of the primary user for whom we want 
     617     * @param int $user_id                          The ID of the primary user for whom we want
    618618     *                                              to check friendships statuses.
    619      * @param int|array|string $possible_friend_ids The IDs of the one or more users 
     619     * @param int|array|string $possible_friend_ids The IDs of the one or more users
    620620     *                                              to check friendship status with primary user.
    621621     * @return null
     
    629629        foreach ( $possible_friend_ids as $friend_id ) {
    630630            // Check for cached items in both friendship directions.
    631             if ( false === bp_core_get_incremented_cache( $user_id . ':' . $friend_id, 'bp_friends' ) 
     631            if ( false === bp_core_get_incremented_cache( $user_id . ':' . $friend_id, 'bp_friends' )
    632632                || false === bp_core_get_incremented_cache( $friend_id . ':' . $user_id, 'bp_friends' ) ) {
    633633                $fetch[] = $friend_id;
     
    650650                $status_initiator = $status_friend = 'is_friend';
    651651            } else {
    652                 $status_initiator = 'pending'; 
     652                $status_initiator = 'pending';
    653653                $status_friend    = 'awaiting_response';
    654654            }
  • trunk/tests/phpunit/testcases/members/template.php

    r11737 r12459  
    4343        bp_has_members( $template_args );
    4444
    45         preg_match( '/&members_search=(.*)\'/', $members_template->pag_links, $matches );
     45        preg_match( '/&members_search=(.*)(\'|\")/', $members_template->pag_links, $matches );
    4646
    4747        $this->assertEquals( urldecode( $matches[1] ), urldecode( $template_args['search_terms'] ) );
Note: See TracChangeset for help on using the changeset viewer.