SimpleMock::invoke PHP Метод

invoke() публичный Метод

Will generate anytest assertions as a result of expectations if there is a test present.
public invoke ( string $method, array $args ) : mixed
$method string Name of method to simulate.
$args array Arguments as an array.
Результат mixed Stored return.
    public function invoke($method, $args)
    {
        $method = strtolower($method);
        $step = $this->getCallCount($method);
        $this->addCall($method, $args);
        $this->checkExpectations($method, $args, $step);
        $was = $this->disableEStrict();
        try {
            $result = $this->emulateCall($method, $args, $step);
        } catch (Exception $e) {
            $this->restoreEStrict($was);
            throw $e;
        }
        $this->restoreEStrict($was);
        return $result;
    }