Changeset 6932
- Timestamp:
- 04/21/2013 05:03:06 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/tests/includes/testcase.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/includes/testcase.php
r6905 r6932 131 131 wp_set_current_user( $user_id ); 132 132 } 133 134 /** 135 * When creating a new user, it's almost always necessary to have the 136 * last_activity usermeta set right away, so that the user shows up in 137 * directory queries. This is a shorthand wrapper for the user factory 138 * create() method. 139 */ 140 function create_user( $args = array() ) { 141 $r = wp_parse_args( $args, array( 142 'role' => 'subscriber', 143 'last_activity' => bp_core_current_time(), 144 ) ); 145 146 $last_activity = $r['last_activity']; 147 unset( $r['last_activity'] ); 148 149 $user_id = $this->factory->user->create( $args ); 150 151 update_user_meta( $user_id, 'last_activity', $last_activity ); 152 153 return $user_id; 154 } 133 155 }
Note: See TracChangeset
for help on using the changeset viewer.