WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/09/2019 05:43:14 AM (5 months ago)
Author:
pento
Message:

Docs: Add docblocks for the PHPUnit factory objects.

Props andizer.
Fixes #44521.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-user.php

    r42343 r44497  
    2222    }
    2323
     24    /**
     25     * Inserts an user.
     26     *
     27     * @param array $args The user data to insert.
     28     *
     29     * @return int|WP_Error
     30     */
    2431    function create_object( $args ) {
    2532        return wp_insert_user( $args );
    2633    }
    2734
     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     */
    2843    function update_object( $user_id, $fields ) {
    2944        $fields['ID'] = $user_id;
     
    3146    }
    3247
     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     */
    3355    function get_object_by_id( $user_id ) {
    3456        return new WP_User( $user_id );
Note: See TracChangeset for help on using the changeset viewer.