~evanj/cms

ref: 8a453a73244ce94c291204147a7ee2cbf61f7ab2 cms/internal/c/content/content_mock.go -rw-r--r-- 9.0 KiB
8a453a73Evan M Jones Fix(testing): Refactor'd tests per RBAC feat breakage. All tests 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
// Code generated by MockGen. DO NOT EDIT.
// Source: content.go

// Package content is a generated GoMock package.
package content

import (
	context "context"
	io "io"
	reflect "reflect"

	content "git.sr.ht/~evanj/cms/internal/m/content"
	contenttype "git.sr.ht/~evanj/cms/internal/m/contenttype"
	space "git.sr.ht/~evanj/cms/internal/m/space"
	user "git.sr.ht/~evanj/cms/internal/m/user"
	db "git.sr.ht/~evanj/cms/internal/s/db"
	hook "git.sr.ht/~evanj/cms/internal/s/hook"
	gomock "github.com/golang/mock/gomock"
)

// MockDBer is a mock of DBer interface
type MockDBer struct {
	ctrl     *gomock.Controller
	recorder *MockDBerMockRecorder
}

// MockDBerMockRecorder is the mock recorder for MockDBer
type MockDBerMockRecorder struct {
	mock *MockDBer
}

// NewMockDBer creates a new mock instance
func NewMockDBer(ctrl *gomock.Controller) *MockDBer {
	mock := &MockDBer{ctrl: ctrl}
	mock.recorder = &MockDBerMockRecorder{mock}
	return mock
}

// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockDBer) EXPECT() *MockDBerMockRecorder {
	return m.recorder
}

// UserGet mocks base method
func (m *MockDBer) UserGet(username, password string) (user.User, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "UserGet", username, password)
	ret0, _ := ret[0].(user.User)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UserGet indicates an expected call of UserGet
func (mr *MockDBerMockRecorder) UserGet(username, password interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UserGet", reflect.TypeOf((*MockDBer)(nil).UserGet), username, password)
}

// UserGetFromToken mocks base method
func (m *MockDBer) UserGetFromToken(token string) (user.User, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "UserGetFromToken", token)
	ret0, _ := ret[0].(user.User)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// UserGetFromToken indicates an expected call of UserGetFromToken
func (mr *MockDBerMockRecorder) UserGetFromToken(token interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UserGetFromToken", reflect.TypeOf((*MockDBer)(nil).UserGetFromToken), token)
}

// SpaceGet mocks base method
func (m *MockDBer) SpaceGet(user user.User, spaceID string) (space.Space, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "SpaceGet", user, spaceID)
	ret0, _ := ret[0].(space.Space)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// SpaceGet indicates an expected call of SpaceGet
func (mr *MockDBerMockRecorder) SpaceGet(user, spaceID interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpaceGet", reflect.TypeOf((*MockDBer)(nil).SpaceGet), user, spaceID)
}

// ContentTypeGet mocks base method
func (m *MockDBer) ContentTypeGet(u user.User, space space.Space, contenttypeID string) (contenttype.ContentType, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "ContentTypeGet", u, space, contenttypeID)
	ret0, _ := ret[0].(contenttype.ContentType)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// ContentTypeGet indicates an expected call of ContentTypeGet
func (mr *MockDBerMockRecorder) ContentTypeGet(u, space, contenttypeID interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContentTypeGet", reflect.TypeOf((*MockDBer)(nil).ContentTypeGet), u, space, contenttypeID)
}

// ContentNew mocks base method
func (m *MockDBer) ContentNew(u user.User, space space.Space, ct contenttype.ContentType, params []db.ContentNewParam) (content.Content, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "ContentNew", u, space, ct, params)
	ret0, _ := ret[0].(content.Content)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// ContentNew indicates an expected call of ContentNew
func (mr *MockDBerMockRecorder) ContentNew(u, space, ct, params interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContentNew", reflect.TypeOf((*MockDBer)(nil).ContentNew), u, space, ct, params)
}

// ContentGet mocks base method
func (m *MockDBer) ContentGet(u user.User, space space.Space, ct contenttype.ContentType, contentID string) (content.Content, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "ContentGet", u, space, ct, contentID)
	ret0, _ := ret[0].(content.Content)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// ContentGet indicates an expected call of ContentGet
func (mr *MockDBerMockRecorder) ContentGet(u, space, ct, contentID interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContentGet", reflect.TypeOf((*MockDBer)(nil).ContentGet), u, space, ct, contentID)
}

// ContentUpdate mocks base method
func (m *MockDBer) ContentUpdate(u user.User, space space.Space, ct contenttype.ContentType, c content.Content, newParams []db.ContentNewParam, updateParams []db.ContentUpdateParam) (content.Content, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "ContentUpdate", u, space, ct, c, newParams, updateParams)
	ret0, _ := ret[0].(content.Content)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// ContentUpdate indicates an expected call of ContentUpdate
func (mr *MockDBerMockRecorder) ContentUpdate(u, space, ct, content, newParams, updateParams interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContentUpdate", reflect.TypeOf((*MockDBer)(nil).ContentUpdate), u, space, ct, content, newParams, updateParams)
}

// ContentDelete mocks base method
func (m *MockDBer) ContentDelete(u user.User, space space.Space, ct contenttype.ContentType, content content.Content) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "ContentDelete", u, space, ct, content)
	ret0, _ := ret[0].(error)
	return ret0
}

// ContentDelete indicates an expected call of ContentDelete
func (mr *MockDBerMockRecorder) ContentDelete(u, space, ct, content interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContentDelete", reflect.TypeOf((*MockDBer)(nil).ContentDelete), u, space, ct, content)
}

// ContentSearch mocks base method
func (m *MockDBer) ContentSearch(u user.User, space space.Space, ct contenttype.ContentType, name, query string, before int) (content.ContentList, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "ContentSearch", u, space, ct, name, query, before)
	ret0, _ := ret[0].(content.ContentList)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// ContentSearch indicates an expected call of ContentSearch
func (mr *MockDBerMockRecorder) ContentSearch(u, space, ct, name, query, before interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContentSearch", reflect.TypeOf((*MockDBer)(nil).ContentSearch), u, space, ct, name, query, before)
}

// MockE3er is a mock of E3er interface
type MockE3er struct {
	ctrl     *gomock.Controller
	recorder *MockE3erMockRecorder
}

// MockE3erMockRecorder is the mock recorder for MockE3er
type MockE3erMockRecorder struct {
	mock *MockE3er
}

// NewMockE3er creates a new mock instance
func NewMockE3er(ctrl *gomock.Controller) *MockE3er {
	mock := &MockE3er{ctrl: ctrl}
	mock.recorder = &MockE3erMockRecorder{mock}
	return mock
}

// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockE3er) EXPECT() *MockE3erMockRecorder {
	return m.recorder
}

// Upload mocks base method
func (m *MockE3er) Upload(ctx context.Context, public bool, filename string, file io.Reader) (string, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "Upload", ctx, public, filename, file)
	ret0, _ := ret[0].(string)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// Upload indicates an expected call of Upload
func (mr *MockE3erMockRecorder) Upload(ctx, public, filename, file interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Upload", reflect.TypeOf((*MockE3er)(nil).Upload), ctx, public, filename, file)
}

// MockHooker is a mock of Hooker interface
type MockHooker struct {
	ctrl     *gomock.Controller
	recorder *MockHookerMockRecorder
}

// MockHookerMockRecorder is the mock recorder for MockHooker
type MockHookerMockRecorder struct {
	mock *MockHooker
}

// NewMockHooker creates a new mock instance
func NewMockHooker(ctrl *gomock.Controller) *MockHooker {
	mock := &MockHooker{ctrl: ctrl}
	mock.recorder = &MockHookerMockRecorder{mock}
	return mock
}

// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockHooker) EXPECT() *MockHookerMockRecorder {
	return m.recorder
}

// Do mocks base method
func (m *MockHooker) Do(user user.User, space space.Space, content content.Content, ht hook.HookType) {
	m.ctrl.T.Helper()
	m.ctrl.Call(m, "Do", user, space, content, ht)
}

// Do indicates an expected call of Do
func (mr *MockHookerMockRecorder) Do(user, space, content, ht interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Do", reflect.TypeOf((*MockHooker)(nil).Do), user, space, content, ht)
}