PHP Class WP_UnitTest_Factory_For_Thing

Mostra file Open project: lucatume/wp-browser Class Usage Examples

Public Properties

Property Type Description
$default_generation_definitions
$factory

Public Methods

Method Description
__construct ( object $factory, array $default_generation_definitions = [] ) Creates a new factory, which will create objects of a specific Thing
addslashes_deep ( $value )
apply_callbacks ( $callbacks, $created )
callback ( $function )
create ( $args = [], $generation_definitions = null )
create_and_get ( $args = [], $generation_definitions = null )
create_many ( $count, $args = [], $generation_definitions = null )
create_object ( $args )
generate_args ( $args = [], $generation_definitions = null, &$callbacks = null )
get_object_by_id ( $object_id )
update_object ( $object, $fields )

Method Details

__construct() public method

Creates a new factory, which will create objects of a specific Thing
public __construct ( object $factory, array $default_generation_definitions = [] )
$factory object Global factory that can be used to create other objects on the system
$default_generation_definitions array Defines what default values should the properties of the object have. The default values can be generators -- an object with next() method. There are some default generators: {@link WP_UnitTest_Generator_Sequence}, {@link WP_UnitTest_Generator_Locale_Name}, {@link WP_UnitTest_Factory_Callback_After_Create}.

addslashes_deep() public method

public addslashes_deep ( $value )

apply_callbacks() public method

public apply_callbacks ( $callbacks, $created )

callback() public method

public callback ( $function )

create() public method

public create ( $args = [], $generation_definitions = null )

create_and_get() public method

public create_and_get ( $args = [], $generation_definitions = null )

create_many() public method

public create_many ( $count, $args = [], $generation_definitions = null )

create_object() abstract public method

abstract public create_object ( $args )

generate_args() public method

public generate_args ( $args = [], $generation_definitions = null, &$callbacks = null )

get_object_by_id() abstract public method

abstract public get_object_by_id ( $object_id )

update_object() abstract public method

abstract public update_object ( $object, $fields )

Property Details

$default_generation_definitions public_oe property

public $default_generation_definitions

$factory public_oe property

public $factory