WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/30/2017 04:35:39 AM (3 years ago)
Author:
DrewAPicture
Message:

Tests: Add @method notations to factor class DocBlocks as a way to indicate expected return types from factory methods for the benefit of IDEs.

Props jdgrimes.
Fixes #37867.

File:
1 edited

Legend:

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

    r36347 r40968  
    11<?php
    22
     3/**
     4 * Unit test factory for terms.
     5 *
     6 * Note: The below @method notations are defined solely for the benefit of IDEs,
     7 * as a way to indicate expected return values from the given factory methods.
     8 *
     9 * @method int create( $args = array(), $generation_definitions = null )
     10 * @method int[] create_many( $count, $args = array(), $generation_definitions = null )
     11 */
    312class WP_UnitTest_Factory_For_Term extends WP_UnitTest_Factory_For_Thing {
    413
     
    3645    }
    3746
     47    /**
     48     * @return array|null|WP_Error|WP_Term
     49     */
    3850    function create_and_get( $args = array(), $generation_definitions = null ) {
    3951        $term_id = $this->create( $args, $generation_definitions );
Note: See TracChangeset for help on using the changeset viewer.