summaryrefslogtreecommitdiffstats
path: root/plugin/plugintest
diff options
context:
space:
mode:
authorJason Mojica <jason@jasonmojica.net>2018-10-25 17:24:43 +0000
committerJesse Hallam <jesse.hallam@gmail.com>2018-10-25 13:24:43 -0400
commit1074a1c7ab0769b0da3525282fcabf961e2ddfce (patch)
tree4fc4f2701ccc6dc4f40c22f604e6581a168aa9d0 /plugin/plugintest
parentdd60ad0db76a00a92d25d7923bf8fb54ebf4a531 (diff)
downloadchat-1074a1c7ab0769b0da3525282fcabf961e2ddfce.tar.gz
chat-1074a1c7ab0769b0da3525282fcabf961e2ddfce.tar.bz2
chat-1074a1c7ab0769b0da3525282fcabf961e2ddfce.zip
GH-9612 Add plugin API for GetChannelStats method (#9627)
* Add GetChannelStats plugin api * Fix to return channel stats correctly * Add server version; Handle error idiomatically
Diffstat (limited to 'plugin/plugintest')
-rw-r--r--plugin/plugintest/api.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/plugin/plugintest/api.go b/plugin/plugintest/api.go
index 81462e58d..d24b955ae 100644
--- a/plugin/plugintest/api.go
+++ b/plugin/plugintest/api.go
@@ -483,6 +483,31 @@ func (_m *API) GetChannelsForTeamForUser(teamId string, userId string, includeDe
return r0, r1
}
+// GetChannelStats provides a mock function with given fields: channelId
+func (_m *API) GetChannelStats(channelId string) (*model.ChannelStats, *model.AppError) {
+ ret := _m.Called(channelId)
+
+ var r0 *model.ChannelStats
+ if rf, ok := ret.Get(0).(func(string) *model.ChannelStats); ok {
+ r0 = rf(channelId)
+ } else {
+ if ret.Get(0) != nil {
+ r0 = ret.Get(0).(*model.ChannelStats)
+ }
+ }
+
+ var r1 *model.AppError
+ if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
+ r1 = rf(channelId)
+ } else {
+ if ret.Get(1) != nil {
+ r1 = ret.Get(1).(*model.AppError)
+ }
+ }
+
+ return r0, r1
+}
+
// GetConfig provides a mock function with given fields:
func (_m *API) GetConfig() *model.Config {
ret := _m.Called()