Skip to:
Content

BuddyPress.org

Changeset 8326


Ignore:
Timestamp:
04/28/2014 10:27:51 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Add unit test for comparing subsequent calls to BP_Core_User::get_last_activity() to compare cached results to uncached results. See #5597, to test logic introduced in r8047.

File:
1 edited

Legend:

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

    r8321 r8326  
    177177     * @group last_activity
    178178     */
     179    public function test_get_last_activity_in_cache_single_user() {
     180        $u    = $this->create_user();
     181        $time = bp_core_current_time();
     182
     183        BP_Core_User::update_last_activity( $u, $time );
     184
     185        // Cache is set during user creation. Clear to reflect actual pageload
     186        wp_cache_delete( $u, 'bp_last_activity' );
     187
     188        // prime cache
     189        $a = BP_Core_User::get_last_activity( $u );
     190        $b = BP_Core_User::get_last_activity( $u );
     191
     192        $this->assertSame( $a, $b );
     193    }
     194
     195    /**
     196     * @group last_activity
     197     */
    179198    public function test_update_last_activity() {
    180199        $u = $this->create_user();
Note: See TracChangeset for help on using the changeset viewer.