MongolidLaravel\MongolidModel::callMockOrParent PHP Метод

callMockOrParent() защищенный статический Метод

Calls mock method if its have expectations. Calls parent method otherwise.
protected static callMockOrParent ( string $method, array $arguments ) : mixed
$method string Name of the method being called.
$arguments array Arguments to pass in method call.
Результат mixed See parent implementation
    protected static function callMockOrParent(string $method, array $arguments)
    {
        $classToCall = 'parent';
        $class = get_called_class();
        $mock = static::$mock[$class] ?? null;
        if ($mock && $mock->mockery_getExpectationsFor($method)) {
            $classToCall = $mock;
        }
        return call_user_func_array([$classToCall, $method], $arguments);
    }