class TestUtils (View source)

Methods

static mixed
invokeMethod(string $methodName, array $parameters = [])

Call protected/private non-static method of an object.

static mixed
invokeStaticMethod(string $className, string $methodName, array $parameters = [])

Call protected/private static method of a class.

static mixed
setProperty(string $propertyName, mixed $value)

Set protected/private non-static property of an object.

static mixed
getProperty(string $propertyName)

Get protected/private non-static property of an object.

static mixed
setStaticProperty(object $className, string $propertyName, mixed $value)

Set protected/private static property of a class.

static mixed
getStaticProperty(object $className, string $propertyName)

Get protected/private static property of a class.

Details

static mixed invokeMethod(string $methodName, array $parameters = [])

Call protected/private non-static method of an object.

Parameters

string $methodName Method name to call
array $parameters Array of parameters to pass into method.

Return Value

mixed Method return.

static mixed invokeStaticMethod(string $className, string $methodName, array $parameters = [])

Call protected/private static method of a class.

Parameters

string $className Name of the class for the static method.
string $methodName Method name to call
array $parameters Array of parameters to pass into method.

Return Value

mixed Method return.

static mixed setProperty(string $propertyName, mixed $value)

Set protected/private non-static property of an object.

Parameters

string $propertyName Name of the property to set.
mixed $value New value for the property.

Return Value

mixed Previous value for the property before the update.

static mixed getProperty(string $propertyName)

Get protected/private non-static property of an object.

Parameters

string $propertyName Name of the property to get.

Return Value

mixed The value of the property.

static mixed setStaticProperty(object $className, string $propertyName, mixed $value)

Set protected/private static property of a class.

Parameters

object $className Name of the class for the static property.
string $propertyName Name of the property to set.
mixed $value New value for the property.

Return Value

mixed Previous value for the property before the update.

static mixed getStaticProperty(object $className, string $propertyName)

Get protected/private static property of a class.

Parameters

object $className Name of the class for the static property.
string $propertyName Name of the property to get.

Return Value

mixed The value for the property.