Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/14/2014 02:29:07 PM (11 years ago)
Author:
boonebgorges
Message:

Tests: create users with explicit last_activity time in get_value_byid() tests

This ensures that slow test suites don't create mismatches. (Looking at you,
Travis-CI)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/testcases/xprofile/class-bp-xprofile-profiledata.php

    r7873 r7880  
    146146     */
    147147    public function test_get_value_byid_multipleusers_uncached() {
    148         $u1 = $this->create_user();
    149         $u2 = $this->create_user();
    150         $g = $this->factory->xprofile_group->create();
    151         $f = $this->factory->xprofile_field->create( array(
    152             'type' => 'textbox',
    153             'field_group_id' => $g,
    154         ) );
    155 
    156148        $time = bp_core_current_time();
     149
     150        $u1 = $this->create_user( array(
     151            'last_activity' => $time,
     152        ) );
     153        $u2 = $this->create_user( array(
     154            'last_activity' => $time,
     155        ) );
     156        $g = $this->factory->xprofile_group->create();
     157        $f = $this->factory->xprofile_field->create( array(
     158            'type' => 'textbox',
     159            'field_group_id' => $g,
     160        ) );
    157161
    158162        $d1 = new BP_XProfile_ProfileData();
     
    219223     */
    220224    public function test_get_value_byid_multipleusers_cached() {
    221         $u1 = $this->create_user();
    222         $u2 = $this->create_user();
    223         $g = $this->factory->xprofile_group->create();
    224         $f = $this->factory->xprofile_field->create( array(
    225             'type' => 'textbox',
    226             'field_group_id' => $g,
    227         ) );
    228 
    229225        $time = bp_core_current_time();
     226
     227        $u1 = $this->create_user( array(
     228            'last_activity' => $time,
     229        ) );
     230        $u2 = $this->create_user( array(
     231            'last_activity' => $time,
     232        ) );
     233        $g = $this->factory->xprofile_group->create();
     234        $f = $this->factory->xprofile_field->create( array(
     235            'type' => 'textbox',
     236            'field_group_id' => $g,
     237        ) );
    230238
    231239        // Fake the cache
Note: See TracChangeset for help on using the changeset viewer.