1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package auth
6
7import (
8 "time"
9
10 "github.com/bnema/purego-pam"
11 mock "github.com/stretchr/testify/mock"
12)
13
14// newMockpamTransaction creates a new instance of mockpamTransaction. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
15// The first argument is typically a *testing.T value.
16func newMockpamTransaction(t interface {
17 mock.TestingT
18 Cleanup(func())
19}) *mockpamTransaction {
20 if helper, ok := t.(interface{ Helper() }); ok {
21 helper.Helper()
22 }
23
24 mock := &mockpamTransaction{}
25 mock.Mock.Test(t)
26
27 t.Cleanup(func() {
28 if helper, ok := t.(interface{ Helper() }); ok {
29 helper.Helper()
30 }
31 mock.AssertExpectations(t)
32 })
33
34 return mock
35}
36
37// mockpamTransaction is an autogenerated mock type for the pamTransaction type
38type mockpamTransaction struct {
39 mock.Mock
40}
41
42type mockpamTransaction_Expecter struct {
43 mock *mock.Mock
44}
45
46func (_m *mockpamTransaction) EXPECT() *mockpamTransaction_Expecter {
47 return &mockpamTransaction_Expecter{mock: &_m.Mock}
48}
49
50// Authenticate provides a mock function for the type mockpamTransaction
51func (_mock *mockpamTransaction) Authenticate(flags pam.Flags) error {
52 ret := _mock.Called(flags)
53
54 if len(ret) == 0 {
55 panic("no return value specified for Authenticate")
56 }
57
58 var r0 error
59 if returnFunc, ok := ret.Get(0).(func(pam.Flags) error); ok {
60 r0 = returnFunc(flags)
61 } else {
62 r0 = ret.Error(0)
63 }
64 return r0
65}
66
67// mockpamTransaction_Authenticate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Authenticate'
68type mockpamTransaction_Authenticate_Call struct {
69 *mock.Call
70}
71
72// Authenticate is a helper method to define mock.On call
73// - flags pam.Flags
74func (_e *mockpamTransaction_Expecter) Authenticate(flags any) *mockpamTransaction_Authenticate_Call {
75 return &mockpamTransaction_Authenticate_Call{Call: _e.mock.On("Authenticate", flags)}
76}
77
78func (_c *mockpamTransaction_Authenticate_Call) Run(run func(flags pam.Flags)) *mockpamTransaction_Authenticate_Call {
79 _c.Call.Run(func(args mock.Arguments) {
80 var arg0 pam.Flags
81 if args[0] != nil {
82 arg0 = args[0].(pam.Flags)
83 }
84 run(
85 arg0,
86 )
87 })
88 return _c
89}
90
91func (_c *mockpamTransaction_Authenticate_Call) Return(err error) *mockpamTransaction_Authenticate_Call {
92 _c.Call.Return(err)
93 return _c
94}
95
96func (_c *mockpamTransaction_Authenticate_Call) RunAndReturn(run func(flags pam.Flags) error) *mockpamTransaction_Authenticate_Call {
97 _c.Call.Return(run)
98 return _c
99}
100
101// End provides a mock function for the type mockpamTransaction
102func (_mock *mockpamTransaction) End() error {
103 ret := _mock.Called()
104
105 if len(ret) == 0 {
106 panic("no return value specified for End")
107 }
108
109 var r0 error
110 if returnFunc, ok := ret.Get(0).(func() error); ok {
111 r0 = returnFunc()
112 } else {
113 r0 = ret.Error(0)
114 }
115 return r0
116}
117
118// mockpamTransaction_End_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'End'
119type mockpamTransaction_End_Call struct {
120 *mock.Call
121}
122
123// End is a helper method to define mock.On call
124func (_e *mockpamTransaction_Expecter) End() *mockpamTransaction_End_Call {
125 return &mockpamTransaction_End_Call{Call: _e.mock.On("End")}
126}
127
128func (_c *mockpamTransaction_End_Call) Run(run func()) *mockpamTransaction_End_Call {
129 _c.Call.Run(func(args mock.Arguments) {
130 run()
131 })
132 return _c
133}
134
135func (_c *mockpamTransaction_End_Call) Return(err error) *mockpamTransaction_End_Call {
136 _c.Call.Return(err)
137 return _c
138}
139
140func (_c *mockpamTransaction_End_Call) RunAndReturn(run func() error) *mockpamTransaction_End_Call {
141 _c.Call.Return(run)
142 return _c
143}
144
145// newMockpamBackend creates a new instance of mockpamBackend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
146// The first argument is typically a *testing.T value.
147func newMockpamBackend(t interface {
148 mock.TestingT
149 Cleanup(func())
150}) *mockpamBackend {
151 if helper, ok := t.(interface{ Helper() }); ok {
152 helper.Helper()
153 }
154
155 mock := &mockpamBackend{}
156 mock.Mock.Test(t)
157
158 t.Cleanup(func() {
159 if helper, ok := t.(interface{ Helper() }); ok {
160 helper.Helper()
161 }
162 mock.AssertExpectations(t)
163 })
164
165 return mock
166}
167
168// mockpamBackend is an autogenerated mock type for the pamBackend type
169type mockpamBackend struct {
170 mock.Mock
171}
172
173type mockpamBackend_Expecter struct {
174 mock *mock.Mock
175}
176
177func (_m *mockpamBackend) EXPECT() *mockpamBackend_Expecter {
178 return &mockpamBackend_Expecter{mock: &_m.Mock}
179}
180
181// start provides a mock function for the type mockpamBackend
182func (_mock *mockpamBackend) start(service string, user string, conversation pam.Conversation) (pamTransaction, error) {
183 ret := _mock.Called(service, user, conversation)
184
185 if len(ret) == 0 {
186 panic("no return value specified for start")
187 }
188
189 var r0 pamTransaction
190 var r1 error
191 if returnFunc, ok := ret.Get(0).(func(string, string, pam.Conversation) (pamTransaction, error)); ok {
192 return returnFunc(service, user, conversation)
193 }
194 if returnFunc, ok := ret.Get(0).(func(string, string, pam.Conversation) pamTransaction); ok {
195 r0 = returnFunc(service, user, conversation)
196 } else {
197 if ret.Get(0) != nil {
198 r0 = ret.Get(0).(pamTransaction)
199 }
200 }
201 if returnFunc, ok := ret.Get(1).(func(string, string, pam.Conversation) error); ok {
202 r1 = returnFunc(service, user, conversation)
203 } else {
204 r1 = ret.Error(1)
205 }
206 return r0, r1
207}
208
209// mockpamBackend_start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'start'
210type mockpamBackend_start_Call struct {
211 *mock.Call
212}
213
214// start is a helper method to define mock.On call
215// - service string
216// - user string
217// - conversation pam.Conversation
218func (_e *mockpamBackend_Expecter) start(service any, user any, conversation any) *mockpamBackend_start_Call {
219 return &mockpamBackend_start_Call{Call: _e.mock.On("start", service, user, conversation)}
220}
221
222func (_c *mockpamBackend_start_Call) Run(run func(service string, user string, conversation pam.Conversation)) *mockpamBackend_start_Call {
223 _c.Call.Run(func(args mock.Arguments) {
224 var arg0 string
225 if args[0] != nil {
226 arg0 = args[0].(string)
227 }
228 var arg1 string
229 if args[1] != nil {
230 arg1 = args[1].(string)
231 }
232 var arg2 pam.Conversation
233 if args[2] != nil {
234 arg2 = args[2].(pam.Conversation)
235 }
236 run(
237 arg0,
238 arg1,
239 arg2,
240 )
241 })
242 return _c
243}
244
245func (_c *mockpamBackend_start_Call) Return(pamTransactionMoqParam pamTransaction, err error) *mockpamBackend_start_Call {
246 _c.Call.Return(pamTransactionMoqParam, err)
247 return _c
248}
249
250func (_c *mockpamBackend_start_Call) RunAndReturn(run func(service string, user string, conversation pam.Conversation) (pamTransaction, error)) *mockpamBackend_start_Call {
251 _c.Call.Return(run)
252 return _c
253}
254
255// newMockdelayClock creates a new instance of mockdelayClock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
256// The first argument is typically a *testing.T value.
257func newMockdelayClock(t interface {
258 mock.TestingT
259 Cleanup(func())
260}) *mockdelayClock {
261 if helper, ok := t.(interface{ Helper() }); ok {
262 helper.Helper()
263 }
264
265 mock := &mockdelayClock{}
266 mock.Mock.Test(t)
267
268 t.Cleanup(func() {
269 if helper, ok := t.(interface{ Helper() }); ok {
270 helper.Helper()
271 }
272 mock.AssertExpectations(t)
273 })
274
275 return mock
276}
277
278// mockdelayClock is an autogenerated mock type for the delayClock type
279type mockdelayClock struct {
280 mock.Mock
281}
282
283type mockdelayClock_Expecter struct {
284 mock *mock.Mock
285}
286
287func (_m *mockdelayClock) EXPECT() *mockdelayClock_Expecter {
288 return &mockdelayClock_Expecter{mock: &_m.Mock}
289}
290
291// after provides a mock function for the type mockdelayClock
292func (_mock *mockdelayClock) after(d time.Duration) <-chan time.Time {
293 ret := _mock.Called(d)
294
295 if len(ret) == 0 {
296 panic("no return value specified for after")
297 }
298
299 var r0 <-chan time.Time
300 if returnFunc, ok := ret.Get(0).(func(time.Duration) <-chan time.Time); ok {
301 r0 = returnFunc(d)
302 } else {
303 if ret.Get(0) != nil {
304 r0 = ret.Get(0).(<-chan time.Time)
305 }
306 }
307 return r0
308}
309
310// mockdelayClock_after_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'after'
311type mockdelayClock_after_Call struct {
312 *mock.Call
313}
314
315// after is a helper method to define mock.On call
316// - d time.Duration
317func (_e *mockdelayClock_Expecter) after(d any) *mockdelayClock_after_Call {
318 return &mockdelayClock_after_Call{Call: _e.mock.On("after", d)}
319}
320
321func (_c *mockdelayClock_after_Call) Run(run func(d time.Duration)) *mockdelayClock_after_Call {
322 _c.Call.Run(func(args mock.Arguments) {
323 var arg0 time.Duration
324 if args[0] != nil {
325 arg0 = args[0].(time.Duration)
326 }
327 run(
328 arg0,
329 )
330 })
331 return _c
332}
333
334func (_c *mockdelayClock_after_Call) Return(timeCh <-chan time.Time) *mockdelayClock_after_Call {
335 _c.Call.Return(timeCh)
336 return _c
337}
338
339func (_c *mockdelayClock_after_Call) RunAndReturn(run func(d time.Duration) <-chan time.Time) *mockdelayClock_after_Call {
340 _c.Call.Return(run)
341 return _c
342}