- Timestamp:
- 01/09/2019 05:43:14 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-user.php
r42343 r44497 22 22 } 23 23 24 /** 25 * Inserts an user. 26 * 27 * @param array $args The user data to insert. 28 * 29 * @return int|WP_Error 30 */ 24 31 function create_object( $args ) { 25 32 return wp_insert_user( $args ); 26 33 } 27 34 35 /** 36 * Updates the user data. 37 * 38 * @param int $user_id The user id to update. 39 * @param array $fields The user data to update. 40 * 41 * @return int|WP_Error User id on success. WP_Error on failure. 42 */ 28 43 function update_object( $user_id, $fields ) { 29 44 $fields['ID'] = $user_id; … … 31 46 } 32 47 48 /** 49 * Retrieves the user for given user id. 50 * 51 * @param int $user_id The user id to get. 52 * 53 * @return WP_User The user. 54 */ 33 55 function get_object_by_id( $user_id ) { 34 56 return new WP_User( $user_id );
Note: See TracChangeset
for help on using the changeset viewer.