Skip to:
Content

BuddyPress.org

Changeset 7032


Ignore:
Timestamp:
05/09/2013 10:13:39 AM (12 years ago)
Author:
boonebgorges
Message:

Run BP_Core_User results through wp_parse_id_list before test assertions

The return values of some BP_Core_User methods are string-cast integers, which
can cause problems when comparing with true integer arrays using assertEquals().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/testcases/core/class-bp-core-user.php

    r7024 r7032  
    4444
    4545        $users = BP_Core_User::get_users( 'active', 0, 1, 0, false, false, true, $exclude_array );
    46         $user_ids = wp_list_pluck( $users['users'], 'id' );
     46        $user_ids = wp_parse_id_list( wp_list_pluck( $users['users'], 'id' ) );
    4747
    4848        $this->assertEquals( array( $u2 ), $user_ids );
     
    5757
    5858        $users = BP_Core_User::get_users( 'active', 0, 1, 0, $include_qs );
    59         $user_ids = wp_list_pluck( $users['users'], 'id' );
     59        $user_ids = wp_parse_id_list( wp_list_pluck( $users['users'], 'id' ) );
    6060
    6161        $this->assertEquals( array( $u1, $u3 ), $user_ids );
     
    9494
    9595        $users = BP_Core_User::get_specific_users( $include_array );
    96         $user_ids = wp_list_pluck( $users['users'], 'id' );
    97 
    98         // sort...ugh
    99         sort( $user_ids );
     96        $user_ids = wp_parse_id_list( wp_list_pluck( $users['users'], 'id' ) );
    10097
    10198        $this->assertEquals( array( $u1, $u3 ), $user_ids );
Note: See TracChangeset for help on using the changeset viewer.