Scalr\Tests\TestCase::getAccessibleMethod PHP Method

getAccessibleMethod() public static method

Gets reflection method for the specified object
public static getAccessibleMethod ( object $object, string $method ) : ReflectionMethod
$object object Object
$method string Private or Protected Method name
return ReflectionMethod Returns reflection method for provided object with setAccessible property
    public static function getAccessibleMethod($object, $method)
    {
        if (is_object($object)) {
            $class = get_class($object);
        } else {
            throw new \Exception(sprintf('Invalid argument. First parameter must be object, %s given.', gettype($object)));
        }
        $ref = new \ReflectionMethod($class, $method);
        $ref->setAccessible(true);
        return $ref;
    }