Make WordPress Core


Ignore:
Timestamp:
03/15/2019 12:15:08 PM (8 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-thing.php

    r44497 r44903  
    66abstract class WP_UnitTest_Factory_For_Thing {
    77
    8         var $default_generation_definitions;
    9         var $factory;
     8        public $default_generation_definitions;
     9        public $factory;
    1010
    1111        /**
     
    1717         * {@link WP_UnitTest_Generator_Locale_Name}, {@link WP_UnitTest_Factory_Callback_After_Create}.
    1818         */
    19         function __construct( $factory, $default_generation_definitions = array() ) {
     19        public function __construct( $factory, $default_generation_definitions = array() ) {
    2020                $this->factory                        = $factory;
    2121                $this->default_generation_definitions = $default_generation_definitions;
     
    2929         * @return mixed The result. Can be anything.
    3030         */
    31         abstract function create_object( $args );
     31        abstract public function create_object( $args );
    3232
    3333        /**
     
    3939         * @return mixed The result. Can be anything.
    4040         */
    41         abstract function update_object( $object, $fields );
     41        abstract public function update_object( $object, $fields );
    4242
    4343        /**
     
    4949         * @return mixed The result. Can be anything.
    5050         */
    51         function create( $args = array(), $generation_definitions = null ) {
     51        public function create( $args = array(), $generation_definitions = null ) {
    5252                if ( is_null( $generation_definitions ) ) {
    5353                        $generation_definitions = $this->default_generation_definitions;
     
    7878         * @return mixed The created object. Can be anything.
    7979         */
    80         function create_and_get( $args = array(), $generation_definitions = null ) {
     80        public function create_and_get( $args = array(), $generation_definitions = null ) {
    8181                $object_id = $this->create( $args, $generation_definitions );
    8282                return $this->get_object_by_id( $object_id );
     
    9090         * @return mixed The object. Can be anything.
    9191         */
    92         abstract function get_object_by_id( $object_id );
     92        abstract public function get_object_by_id( $object_id );
    9393
    9494        /**
     
    101101         * @return array
    102102         */
    103         function create_many( $count, $args = array(), $generation_definitions = null ) {
     103        public function create_many( $count, $args = array(), $generation_definitions = null ) {
    104104                $results = array();
    105105                for ( $i = 0; $i < $count; $i++ ) {
     
    119119         * @return array|WP_Error Combined array on success. WP_Error when default value is incorrent.
    120120         */
    121         function generate_args( $args = array(), $generation_definitions = null, &$callbacks = null ) {
     121        public function generate_args( $args = array(), $generation_definitions = null, &$callbacks = null ) {
    122122                $callbacks = array();
    123123                if ( is_null( $generation_definitions ) ) {
     
    156156         * @return array The altered fields.
    157157         */
    158         function apply_callbacks( $callbacks, $created ) {
     158        public function apply_callbacks( $callbacks, $created ) {
    159159                $updated_fields = array();
    160160
     
    172172         * @return WP_UnitTest_Factory_Callback_After_Create
    173173         */
    174         function callback( $function ) {
     174        public function callback( $function ) {
    175175                return new WP_UnitTest_Factory_Callback_After_Create( $function );
    176176        }
     
    183183         * @return array|string The value with the possibly applied slashes.
    184184         */
    185         function addslashes_deep( $value ) {
     185        public function addslashes_deep( $value ) {
    186186                if ( is_array( $value ) ) {
    187187                        $value = array_map( array( $this, 'addslashes_deep' ), $value );
Note: See TracChangeset for help on using the changeset viewer.