- Timestamp:
- 03/15/2019 12:15:08 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-thing.php
r44497 r44903 6 6 abstract class WP_UnitTest_Factory_For_Thing { 7 7 8 var$default_generation_definitions;9 var$factory;8 public $default_generation_definitions; 9 public $factory; 10 10 11 11 /** … … 17 17 * {@link WP_UnitTest_Generator_Locale_Name}, {@link WP_UnitTest_Factory_Callback_After_Create}. 18 18 */ 19 function __construct( $factory, $default_generation_definitions = array() ) {19 public function __construct( $factory, $default_generation_definitions = array() ) { 20 20 $this->factory = $factory; 21 21 $this->default_generation_definitions = $default_generation_definitions; … … 29 29 * @return mixed The result. Can be anything. 30 30 */ 31 abstract function create_object( $args );31 abstract public function create_object( $args ); 32 32 33 33 /** … … 39 39 * @return mixed The result. Can be anything. 40 40 */ 41 abstract function update_object( $object, $fields );41 abstract public function update_object( $object, $fields ); 42 42 43 43 /** … … 49 49 * @return mixed The result. Can be anything. 50 50 */ 51 function create( $args = array(), $generation_definitions = null ) {51 public function create( $args = array(), $generation_definitions = null ) { 52 52 if ( is_null( $generation_definitions ) ) { 53 53 $generation_definitions = $this->default_generation_definitions; … … 78 78 * @return mixed The created object. Can be anything. 79 79 */ 80 function create_and_get( $args = array(), $generation_definitions = null ) {80 public function create_and_get( $args = array(), $generation_definitions = null ) { 81 81 $object_id = $this->create( $args, $generation_definitions ); 82 82 return $this->get_object_by_id( $object_id ); … … 90 90 * @return mixed The object. Can be anything. 91 91 */ 92 abstract function get_object_by_id( $object_id );92 abstract public function get_object_by_id( $object_id ); 93 93 94 94 /** … … 101 101 * @return array 102 102 */ 103 function create_many( $count, $args = array(), $generation_definitions = null ) {103 public function create_many( $count, $args = array(), $generation_definitions = null ) { 104 104 $results = array(); 105 105 for ( $i = 0; $i < $count; $i++ ) { … … 119 119 * @return array|WP_Error Combined array on success. WP_Error when default value is incorrent. 120 120 */ 121 function generate_args( $args = array(), $generation_definitions = null, &$callbacks = null ) {121 public function generate_args( $args = array(), $generation_definitions = null, &$callbacks = null ) { 122 122 $callbacks = array(); 123 123 if ( is_null( $generation_definitions ) ) { … … 156 156 * @return array The altered fields. 157 157 */ 158 function apply_callbacks( $callbacks, $created ) {158 public function apply_callbacks( $callbacks, $created ) { 159 159 $updated_fields = array(); 160 160 … … 172 172 * @return WP_UnitTest_Factory_Callback_After_Create 173 173 */ 174 function callback( $function ) {174 public function callback( $function ) { 175 175 return new WP_UnitTest_Factory_Callback_After_Create( $function ); 176 176 } … … 183 183 * @return array|string The value with the possibly applied slashes. 184 184 */ 185 function addslashes_deep( $value ) {185 public function addslashes_deep( $value ) { 186 186 if ( is_array( $value ) ) { 187 187 $value = array_map( array( $this, 'addslashes_deep' ), $value );
Note: See TracChangeset
for help on using the changeset viewer.