diff options
author | Daniel Schalla <daniel@schalla.me> | 2018-07-30 20:55:38 +0200 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2018-07-30 11:55:38 -0700 |
commit | d23ca07133e9bc5eed14d87af563471b4ef963cd (patch) | |
tree | ae01bb8f09600110c22a5f881be24e8d6f204986 /plugin/plugintest | |
parent | 08e54ed8244e2ec9a278d16f80d5ed2a8e2964f4 (diff) | |
download | chat-d23ca07133e9bc5eed14d87af563471b4ef963cd.tar.gz chat-d23ca07133e9bc5eed14d87af563471b4ef963cd.tar.bz2 chat-d23ca07133e9bc5eed14d87af563471b4ef963cd.zip |
Login Hooks (#9177)
Tests; gofmt
Diffstat (limited to 'plugin/plugintest')
-rw-r--r-- | plugin/plugintest/hooks.go | 43 |
1 files changed, 43 insertions, 0 deletions
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 +} |