Skip to:
Content

BuddyPress.org

Changeset 7330


Ignore:
Timestamp:
07/31/2013 01:30:20 PM (11 years ago)
Author:
boonebgorges
Message:

Better member join date ordering in bp_group_has_membrs_with_exclude_banned_0()

This ensures that the order of returned results will be correct on slower test
rigs like Travis. It also accounts correctly for the date_modified date of the
group creator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/testcases/groups/template.php

    r7327 r7330  
    340340     */
    341341    public function test_bp_group_has_members_with_exclude_banned_0() {
    342         $g = $this->factory->group->create();
    343         $u1 = $this->create_user();
    344         $u2 = $this->create_user();
    345 
    346         $this->add_user_to_group( $u1, $g );
    347         $this->add_user_to_group( $u2, $g );
    348 
    349         $m1 = new BP_Groups_Member( $u1, $g );
    350         $m1->ban();
     342        $u1 = $this->create_user();
     343        $u2 = $this->create_user();
     344        $u3 = $this->create_user();
     345
     346        $g = $this->factory->group->create( array(
     347            'creator_id' => $u1,
     348        ) );
     349
     350        $this->add_user_to_group( $u2, $g, array(
     351            'date_modified' => gmdate( 'Y-m-d H:i:s', time() - 60*60*24 ),
     352        ) );
     353        $this->add_user_to_group( $u3, $g, array(
     354            'date_modified' => gmdate( 'Y-m-d H:i:s', time() - 60*60*12 ),
     355        ) );
     356
     357        $m2 = new BP_Groups_Member( $u2, $g );
     358        $m2->ban();
    351359
    352360        global $members_template;
     
    358366
    359367        $ids = wp_parse_id_list( wp_list_pluck( $members_template->members, 'user_id' ) );
    360         $this->assertEquals( array( $u1, $u2, ), $ids );
     368        $this->assertEquals( array( $u1, $u3, $u2 ), $ids );
    361369    }
    362370
     
    378386        ) );
    379387
    380 
    381388        $g = $this->factory->group->create( array(
    382389            'creator_id' => $u1,
Note: See TracChangeset for help on using the changeset viewer.