Goose\Tests\Harness\TestTrait::call PHP Method

call() private method

private call ( string $method ) : mixed
$method string
return mixed
    private function call($method)
    {
        $arguments = func_get_args();
        array_shift($arguments);
        $obj = new self::$CLASS_NAME($this->config());
        $class = new \ReflectionClass(self::$CLASS_NAME);
        if ($class->hasProperty('article')) {
            $prop = $class->getProperty('article');
            $prop->setAccessible(true);
            $prop->setValue($obj, $this->article);
        }
        if ($class->hasProperty('document')) {
            $prop = $class->getProperty('document');
            $prop->setAccessible(true);
            $prop->setValue($obj, $this->document);
        }
        if (!$class->hasMethod($method)) {
            throw new BadMethodCallException();
        }
        $fn = $class->getMethod($method);
        $fn->setAccessible(true);
        $result = $fn->invokeArgs($obj, $arguments);
        return $result;
    }