Open zippy1981 opened 8 years ago
Take a look at this comment. https://github.com/Behat/WebApiExtension/issues/66#issuecomment-263845309
In fact, this repo needs to remove old version of Guzzle compatibility (the one that it doesn't use PSR-7) to change the visibility of this properties.
If you want to get access to the response object without forking this library you can always retrieve it via reflection.
For example, from a sub-class:
protected function getResponse() {
static $propertyReflection;
if ($propertyReflection === null) {
$classReflection = new ReflectionClass(WebApiContext::class);
$propertyReflection = $classReflection->getProperty('response');
$propertyReflection->setAccessible(true);
}
return $propertyReflection->getValue($this);
}
You can do something similar to get the request object. This is a bit of a dirty hack, but it gets the result you want.
If I want to extend that context I need raw access to the request and response object.