Omnipay\Common\Message\AbstractRequestTest::changeProtectedProperty PHP Method

changeProtectedProperty() private method

Allow changing a protected property using reflections.
private changeProtectedProperty ( $property, boolean | true $value = true )
$property
$value boolean | true
    private function changeProtectedProperty($property, $value = true)
    {
        $reflection = new \ReflectionClass($this->request);
        $reflection_property = $reflection->getProperty($property);
        $reflection_property->setAccessible(true);
        $reflection_property->setValue($this->request, $value);
        $reflection_property->setAccessible(false);
    }