Make WordPress Core


Ignore:
Timestamp:
03/15/2019 12:15:08 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Build/Test Tools: Add missing access modifiers to factory classes in phpunit/includes/factory.

Props andizer.
Fixes #46504.

File:
1 edited

Legend:

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

    r44497 r44903  
    1515    const DEFAULT_TAXONOMY = 'post_tag';
    1616
    17     function __construct( $factory = null, $taxonomy = null ) {
     17    public function __construct( $factory = null, $taxonomy = null ) {
    1818        parent::__construct( $factory );
    1919        $this->taxonomy                       = $taxonomy ? $taxonomy : self::DEFAULT_TAXONOMY;
     
    3232     * @return array|WP_Error
    3333     */
    34     function create_object( $args ) {
     34    public function create_object( $args ) {
    3535        $args         = array_merge( array( 'taxonomy' => $this->taxonomy ), $args );
    3636        $term_id_pair = wp_insert_term( $args['name'], $args['taxonomy'], $args );
     
    4949     * @return int The term id.
    5050     */
    51     function update_object( $term, $fields ) {
     51    public function update_object( $term, $fields ) {
    5252        $fields = array_merge( array( 'taxonomy' => $this->taxonomy ), $fields );
    5353        if ( is_object( $term ) ) {
     
    7272     * @return array|false|WP_Error Array of term taxonomy IDs of affected terms. WP_Error or false on failure.
    7373     */
    74     function add_post_terms( $post_id, $terms, $taxonomy, $append = true ) {
     74    public function add_post_terms( $post_id, $terms, $taxonomy, $append = true ) {
    7575        return wp_set_post_terms( $post_id, $terms, $taxonomy, $append );
    7676    }
     
    8484     * @return null|WP_Error|WP_Term WP_Term on success. WP_error if taxonomy does not exist. Null for miscellaneous failure.
    8585     */
    86     function create_and_get( $args = array(), $generation_definitions = null ) {
     86    public function create_and_get( $args = array(), $generation_definitions = null ) {
    8787        $term_id  = $this->create( $args, $generation_definitions );
    8888        $taxonomy = isset( $args['taxonomy'] ) ? $args['taxonomy'] : $this->taxonomy;
     
    9797     * @return null|WP_Error|WP_Term WP_Term on success. WP_error if taxonomy does not exist. Null for miscellaneous failure.
    9898     */
    99     function get_object_by_id( $term_id ) {
     99    public function get_object_by_id( $term_id ) {
    100100        return get_term( $term_id, $this->taxonomy );
    101101    }
Note: See TracChangeset for help on using the changeset viewer.