Skip to:
Content

BuddyPress.org

Changeset 9817


Ignore:
Timestamp:
04/28/2015 07:33:44 PM (11 years ago)
Author:
boonebgorges
Message:

Ensure that we have a fake group ID when creating dummy activity item in test_bp_has_activities_groups_and_friends_scope().

The hardcoded value 324 was matching an actual group when tests were run in a
certain sequence.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/activity/template.php

    r9561 r9817  
    366366                        'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    367367                ) );
     368
     369                // Make sure we get a fake group ID.
     370                global $wpdb, $bp;
     371                $max_group_id = $wpdb->get_var( "SELECT id FROM {$bp->groups->table_name} ORDER BY id DESC LIMIT 1" );
    368372                $this->factory->activity->create( array(
    369373                        'user_id'   => $u3,
    370374                        'component' => 'groups',
    371                         'item_id'   => 324,
     375                        'item_id'   => $max_group_id + 1,
    372376                        'type'      => 'activity_update',
    373377                        'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
Note: See TracChangeset for help on using the changeset viewer.