PHP Class Behat\RestTestingExtension\RestTestingHelper

Datei anzeigen Open project: deminy/behat-rest-testing Class Usage Examples

Public Methods

Method Description
callMethod ( string | object $class, string $methodName, array $args = [] ) : mixed Call a protected/private static/non-static method of given class.
findProperty ( object | string $class, string $name, boolean $access = true ) : ReflectionProperty Finds a property for the given class.
getMethod ( string $className, string $methodName ) : ReflectionMethod A helper method for testing protected/private static/non-static methods.
getProperty ( object | string $class, string $name ) : mixed Returns the current value of a property.
setProperty ( object | string $class, string $name, mixed $value ) : void Sets the new value of a property.

Method Details

callMethod() public static method

Call a protected/private static/non-static method of given class.
public static callMethod ( string | object $class, string $methodName, array $args = [] ) : mixed
$class string | object
$methodName string
$args array
return mixed

findProperty() public static method

Finds a property for the given class.
public static findProperty ( object | string $class, string $name, boolean $access = true ) : ReflectionProperty
$class object | string The class instance or name.
$name string The name of a property.
$access boolean Make the property accessible?
return ReflectionProperty The property.

getMethod() public static method

A helper method for testing protected/private static/non-static methods.
public static getMethod ( string $className, string $methodName ) : ReflectionMethod
$className string
$methodName string
return ReflectionMethod

getProperty() public static method

Returns the current value of a property.
public static getProperty ( object | string $class, string $name ) : mixed
$class object | string The class instance or name.
$name string The name of a property.
return mixed The current value of the property.

setProperty() public static method

Sets the new value of a property.
public static setProperty ( object | string $class, string $name, mixed $value ) : void
$class object | string The class instance or name.
$name string The name of a property.
$value mixed The new value.
return void