Behat\RestTestingExtension\RestTestingHelper::setProperty PHP Method

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
    public static function setProperty($class, $name, $value)
    {
        static::findProperty($class, $name)->setValue(is_object($class) ? $class : null, $value);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @param ResponseInterface $response
  * @return void
  */
 protected function setResponse(ResponseInterface $response)
 {
     RestTestingHelper::setProperty(self::getWebApiContext(), 'response', $response);
 }