// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package auth import ( "time" "github.com/bnema/purego-pam" mock "github.com/stretchr/testify/mock" ) // 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. // The first argument is typically a *testing.T value. func newMockpamTransaction(t interface { mock.TestingT Cleanup(func()) }) *mockpamTransaction { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &mockpamTransaction{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // mockpamTransaction is an autogenerated mock type for the pamTransaction type type mockpamTransaction struct { mock.Mock } type mockpamTransaction_Expecter struct { mock *mock.Mock } func (_m *mockpamTransaction) EXPECT() *mockpamTransaction_Expecter { return &mockpamTransaction_Expecter{mock: &_m.Mock} } // Authenticate provides a mock function for the type mockpamTransaction func (_mock *mockpamTransaction) Authenticate(flags pam.Flags) error { ret := _mock.Called(flags) if len(ret) == 0 { panic("no return value specified for Authenticate") } var r0 error if returnFunc, ok := ret.Get(0).(func(pam.Flags) error); ok { r0 = returnFunc(flags) } else { r0 = ret.Error(0) } return r0 } // mockpamTransaction_Authenticate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Authenticate' type mockpamTransaction_Authenticate_Call struct { *mock.Call } // Authenticate is a helper method to define mock.On call // - flags pam.Flags func (_e *mockpamTransaction_Expecter) Authenticate(flags any) *mockpamTransaction_Authenticate_Call { return &mockpamTransaction_Authenticate_Call{Call: _e.mock.On("Authenticate", flags)} } func (_c *mockpamTransaction_Authenticate_Call) Run(run func(flags pam.Flags)) *mockpamTransaction_Authenticate_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 pam.Flags if args[0] != nil { arg0 = args[0].(pam.Flags) } run( arg0, ) }) return _c } func (_c *mockpamTransaction_Authenticate_Call) Return(err error) *mockpamTransaction_Authenticate_Call { _c.Call.Return(err) return _c } func (_c *mockpamTransaction_Authenticate_Call) RunAndReturn(run func(flags pam.Flags) error) *mockpamTransaction_Authenticate_Call { _c.Call.Return(run) return _c } // End provides a mock function for the type mockpamTransaction func (_mock *mockpamTransaction) End() error { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for End") } var r0 error if returnFunc, ok := ret.Get(0).(func() error); ok { r0 = returnFunc() } else { r0 = ret.Error(0) } return r0 } // mockpamTransaction_End_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'End' type mockpamTransaction_End_Call struct { *mock.Call } // End is a helper method to define mock.On call func (_e *mockpamTransaction_Expecter) End() *mockpamTransaction_End_Call { return &mockpamTransaction_End_Call{Call: _e.mock.On("End")} } func (_c *mockpamTransaction_End_Call) Run(run func()) *mockpamTransaction_End_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *mockpamTransaction_End_Call) Return(err error) *mockpamTransaction_End_Call { _c.Call.Return(err) return _c } func (_c *mockpamTransaction_End_Call) RunAndReturn(run func() error) *mockpamTransaction_End_Call { _c.Call.Return(run) return _c } // 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. // The first argument is typically a *testing.T value. func newMockpamBackend(t interface { mock.TestingT Cleanup(func()) }) *mockpamBackend { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &mockpamBackend{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // mockpamBackend is an autogenerated mock type for the pamBackend type type mockpamBackend struct { mock.Mock } type mockpamBackend_Expecter struct { mock *mock.Mock } func (_m *mockpamBackend) EXPECT() *mockpamBackend_Expecter { return &mockpamBackend_Expecter{mock: &_m.Mock} } // start provides a mock function for the type mockpamBackend func (_mock *mockpamBackend) start(service string, user string, conversation pam.Conversation) (pamTransaction, error) { ret := _mock.Called(service, user, conversation) if len(ret) == 0 { panic("no return value specified for start") } var r0 pamTransaction var r1 error if returnFunc, ok := ret.Get(0).(func(string, string, pam.Conversation) (pamTransaction, error)); ok { return returnFunc(service, user, conversation) } if returnFunc, ok := ret.Get(0).(func(string, string, pam.Conversation) pamTransaction); ok { r0 = returnFunc(service, user, conversation) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(pamTransaction) } } if returnFunc, ok := ret.Get(1).(func(string, string, pam.Conversation) error); ok { r1 = returnFunc(service, user, conversation) } else { r1 = ret.Error(1) } return r0, r1 } // mockpamBackend_start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'start' type mockpamBackend_start_Call struct { *mock.Call } // start is a helper method to define mock.On call // - service string // - user string // - conversation pam.Conversation func (_e *mockpamBackend_Expecter) start(service any, user any, conversation any) *mockpamBackend_start_Call { return &mockpamBackend_start_Call{Call: _e.mock.On("start", service, user, conversation)} } func (_c *mockpamBackend_start_Call) Run(run func(service string, user string, conversation pam.Conversation)) *mockpamBackend_start_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } var arg2 pam.Conversation if args[2] != nil { arg2 = args[2].(pam.Conversation) } run( arg0, arg1, arg2, ) }) return _c } func (_c *mockpamBackend_start_Call) Return(pamTransactionMoqParam pamTransaction, err error) *mockpamBackend_start_Call { _c.Call.Return(pamTransactionMoqParam, err) return _c } func (_c *mockpamBackend_start_Call) RunAndReturn(run func(service string, user string, conversation pam.Conversation) (pamTransaction, error)) *mockpamBackend_start_Call { _c.Call.Return(run) return _c } // 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. // The first argument is typically a *testing.T value. func newMockdelayClock(t interface { mock.TestingT Cleanup(func()) }) *mockdelayClock { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &mockdelayClock{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // mockdelayClock is an autogenerated mock type for the delayClock type type mockdelayClock struct { mock.Mock } type mockdelayClock_Expecter struct { mock *mock.Mock } func (_m *mockdelayClock) EXPECT() *mockdelayClock_Expecter { return &mockdelayClock_Expecter{mock: &_m.Mock} } // after provides a mock function for the type mockdelayClock func (_mock *mockdelayClock) after(d time.Duration) <-chan time.Time { ret := _mock.Called(d) if len(ret) == 0 { panic("no return value specified for after") } var r0 <-chan time.Time if returnFunc, ok := ret.Get(0).(func(time.Duration) <-chan time.Time); ok { r0 = returnFunc(d) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(<-chan time.Time) } } return r0 } // mockdelayClock_after_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'after' type mockdelayClock_after_Call struct { *mock.Call } // after is a helper method to define mock.On call // - d time.Duration func (_e *mockdelayClock_Expecter) after(d any) *mockdelayClock_after_Call { return &mockdelayClock_after_Call{Call: _e.mock.On("after", d)} } func (_c *mockdelayClock_after_Call) Run(run func(d time.Duration)) *mockdelayClock_after_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 time.Duration if args[0] != nil { arg0 = args[0].(time.Duration) } run( arg0, ) }) return _c } func (_c *mockdelayClock_after_Call) Return(timeCh <-chan time.Time) *mockdelayClock_after_Call { _c.Call.Return(timeCh) return _c } func (_c *mockdelayClock_after_Call) RunAndReturn(run func(d time.Duration) <-chan time.Time) *mockdelayClock_after_Call { _c.Call.Return(run) return _c }