From d23ca07133e9bc5eed14d87af563471b4ef963cd Mon Sep 17 00:00:00 2001 From: Daniel Schalla Date: Mon, 30 Jul 2018 20:55:38 +0200 Subject: Login Hooks (#9177) Tests; gofmt --- plugin/plugintest/hooks.go | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'plugin/plugintest') diff --git a/plugin/plugintest/hooks.go b/plugin/plugintest/hooks.go index d88792f58..838cccc02 100644 --- a/plugin/plugintest/hooks.go +++ b/plugin/plugintest/hooks.go @@ -5,6 +5,7 @@ package plugintest import http "net/http" +import io "io" import mock "github.com/stretchr/testify/mock" import model "github.com/mattermost/mattermost-server/model" import plugin "github.com/mattermost/mattermost-server/plugin" @@ -44,6 +45,29 @@ func (_m *Hooks) ExecuteCommand(c *plugin.Context, args *model.CommandArgs) (*mo return r0, r1 } +// FileWillBeUploaded provides a mock function with given fields: c, info, file, output +func (_m *Hooks) FileWillBeUploaded(c *plugin.Context, info *model.FileInfo, file io.Reader, output io.Writer) (*model.FileInfo, string) { + ret := _m.Called(c, info, file, output) + + var r0 *model.FileInfo + if rf, ok := ret.Get(0).(func(*plugin.Context, *model.FileInfo, io.Reader, io.Writer) *model.FileInfo); ok { + r0 = rf(c, info, file, output) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.FileInfo) + } + } + + var r1 string + if rf, ok := ret.Get(1).(func(*plugin.Context, *model.FileInfo, io.Reader, io.Writer) string); ok { + r1 = rf(c, info, file, output) + } else { + r1 = ret.Get(1).(string) + } + + return r0, r1 +} + // Implemented provides a mock function with given fields: func (_m *Hooks) Implemented() ([]string, error) { ret := _m.Called() @@ -189,3 +213,22 @@ func (_m *Hooks) UserHasLeftChannel(c *plugin.Context, channelMember *model.Chan func (_m *Hooks) UserHasLeftTeam(c *plugin.Context, teamMember *model.TeamMember, actor *model.User) { _m.Called(c, teamMember, actor) } + +// UserHasLoggedIn provides a mock function with given fields: c, user +func (_m *Hooks) UserHasLoggedIn(c *plugin.Context, user *model.User) { + _m.Called(c, user) +} + +// UserWillLogIn provides a mock function with given fields: c, user +func (_m *Hooks) UserWillLogIn(c *plugin.Context, user *model.User) string { + ret := _m.Called(c, user) + + var r0 string + if rf, ok := ret.Get(0).(func(*plugin.Context, *model.User) string); ok { + r0 = rf(c, user) + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} -- cgit v1.2.3-1-g7c22