Skip to:
Content

BuddyPress.org

Changeset 7107


Ignore:
Timestamp:
05/27/2013 12:50:22 PM (11 years ago)
Author:
boonebgorges
Message:

Be explicit about activity dates in test_bp_has_activities_favorites_action_filter()

This ensures that we can predict the order in which they'll be returned from
bp_has_activities(), which will ensure that the tests pass on slower servers
where the create() methods are run in different seconds (like travis)

Location:
trunk/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/includes/factory.php

    r7085 r7107  
    2424            'primary_link' => 'http://example.com',
    2525            'type'         => 'activity_update',
     26            'recorded_time' => bp_core_current_time(),
    2627        );
    2728    }
  • trunk/tests/testcases/activity/template.php

    r7047 r7107  
    6868        $user_id = $this->factory->user->create( array( 'role' => 'subscriber' ) );
    6969
     70        $now = time();
     71
    7072        $a1 = $this->factory->activity->create( array(
    7173            'type' => 'activity_update',
     74            'recorded_time' => date( 'Y-m-d H:i:s', $now ),
    7275        ) );
    7376
    7477        $a2 = $this->factory->activity->create( array(
    7578            'type' => 'joined_group',
     79            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    7680        ) );
    7781
     
    9397        $ids = wp_list_pluck( $activities_template->activities, 'id' );
    9498
    95         $this->assertEquals( $ids, array( $a1, $a2 ) );
     99        $this->assertEquals( array( $a1, $a2 ), $ids );
    96100
    97101        $activities_template = null;
     
    108112        $ids = wp_list_pluck( $activities_template->activities, 'id' );
    109113
    110         $this->assertEquals( $ids, array( $a1 ) );
     114        $this->assertEquals( array( $a1 ), $ids );
    111115
    112116        $activities_template = null;
Note: See TracChangeset for help on using the changeset viewer.