Changeset 9123 for trunk/tests/phpunit/testcases/members/functions.php
- Timestamp:
- 11/04/2014 08:17:51 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/members/functions.php
r8958 r9123 412 412 $this->assertSame( NULL, bp_core_get_userid_from_nicename( 'non_existent_user' ) ); 413 413 } 414 415 /** 416 * @group bp_update_user_last_activity 417 */ 418 public function test_bp_last_activity_multi_network() { 419 420 // Filter the usermeta key 421 add_filter( 'bp_get_user_meta_key', array( $this, 'filter_usermeta_key' ) ); 422 423 // We explicitly do not want last_activity created, so use the 424 // WP factory methods 425 $user = $this->factory->user->create(); 426 $time = date( 'Y-m-d H:i:s', time() - 50 ); 427 428 // Update last user activity 429 bp_update_user_last_activity( $user, $time ); 430 431 // Setup parameters to assert to be the same 432 $expected = $time; 433 $found = bp_get_user_meta( $user, 'last_activity', true ); 434 435 $this->assertSame( $expected, $found ); 436 } 437 438 /** 439 * @group bp_update_user_last_activity 440 * @global object $wpdb 441 * @param string $key 442 * @return string 443 */ 444 public function filter_usermeta_key( $key ) { 445 global $wpdb; 446 return $wpdb->prefix . $key; 447 } 414 448 }
Note: See TracChangeset
for help on using the changeset viewer.