github.com/goravel/framework@v1.13.9/contracts/auth/mocks/Auth.go (about) 1 // Code generated by mockery v2.14.0. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 auth "github.com/goravel/framework/contracts/auth" 7 http "github.com/goravel/framework/contracts/http" 8 9 mock "github.com/stretchr/testify/mock" 10 ) 11 12 // Auth is an autogenerated mock type for the Auth type 13 type Auth struct { 14 mock.Mock 15 } 16 17 // Guard provides a mock function with given fields: name 18 func (_m *Auth) Guard(name string) auth.Auth { 19 ret := _m.Called(name) 20 21 var r0 auth.Auth 22 if rf, ok := ret.Get(0).(func(string) auth.Auth); ok { 23 r0 = rf(name) 24 } else { 25 if ret.Get(0) != nil { 26 r0 = ret.Get(0).(auth.Auth) 27 } 28 } 29 30 return r0 31 } 32 33 // Login provides a mock function with given fields: ctx, user 34 func (_m *Auth) Login(ctx http.Context, user interface{}) (string, error) { 35 ret := _m.Called(ctx, user) 36 37 var r0 string 38 if rf, ok := ret.Get(0).(func(http.Context, interface{}) string); ok { 39 r0 = rf(ctx, user) 40 } else { 41 r0 = ret.Get(0).(string) 42 } 43 44 var r1 error 45 if rf, ok := ret.Get(1).(func(http.Context, interface{}) error); ok { 46 r1 = rf(ctx, user) 47 } else { 48 r1 = ret.Error(1) 49 } 50 51 return r0, r1 52 } 53 54 // LoginUsingID provides a mock function with given fields: ctx, id 55 func (_m *Auth) LoginUsingID(ctx http.Context, id interface{}) (string, error) { 56 ret := _m.Called(ctx, id) 57 58 var r0 string 59 if rf, ok := ret.Get(0).(func(http.Context, interface{}) string); ok { 60 r0 = rf(ctx, id) 61 } else { 62 r0 = ret.Get(0).(string) 63 } 64 65 var r1 error 66 if rf, ok := ret.Get(1).(func(http.Context, interface{}) error); ok { 67 r1 = rf(ctx, id) 68 } else { 69 r1 = ret.Error(1) 70 } 71 72 return r0, r1 73 } 74 75 // Logout provides a mock function with given fields: ctx 76 func (_m *Auth) Logout(ctx http.Context) error { 77 ret := _m.Called(ctx) 78 79 var r0 error 80 if rf, ok := ret.Get(0).(func(http.Context) error); ok { 81 r0 = rf(ctx) 82 } else { 83 r0 = ret.Error(0) 84 } 85 86 return r0 87 } 88 89 // Parse provides a mock function with given fields: ctx, token 90 func (_m *Auth) Parse(ctx http.Context, token string) (*auth.Payload, error) { 91 ret := _m.Called(ctx, token) 92 93 var r0 *auth.Payload 94 if rf, ok := ret.Get(0).(func(http.Context, string) *auth.Payload); ok { 95 r0 = rf(ctx, token) 96 } else { 97 if ret.Get(0) != nil { 98 r0 = ret.Get(0).(*auth.Payload) 99 } 100 } 101 102 var r1 error 103 if rf, ok := ret.Get(1).(func(http.Context, string) error); ok { 104 r1 = rf(ctx, token) 105 } else { 106 r1 = ret.Error(1) 107 } 108 109 return r0, r1 110 } 111 112 // Refresh provides a mock function with given fields: ctx 113 func (_m *Auth) Refresh(ctx http.Context) (string, error) { 114 ret := _m.Called(ctx) 115 116 var r0 string 117 if rf, ok := ret.Get(0).(func(http.Context) string); ok { 118 r0 = rf(ctx) 119 } else { 120 r0 = ret.Get(0).(string) 121 } 122 123 var r1 error 124 if rf, ok := ret.Get(1).(func(http.Context) error); ok { 125 r1 = rf(ctx) 126 } else { 127 r1 = ret.Error(1) 128 } 129 130 return r0, r1 131 } 132 133 // User provides a mock function with given fields: ctx, user 134 func (_m *Auth) User(ctx http.Context, user interface{}) error { 135 ret := _m.Called(ctx, user) 136 137 var r0 error 138 if rf, ok := ret.Get(0).(func(http.Context, interface{}) error); ok { 139 r0 = rf(ctx, user) 140 } else { 141 r0 = ret.Error(0) 142 } 143 144 return r0 145 } 146 147 type mockConstructorTestingTNewAuth interface { 148 mock.TestingT 149 Cleanup(func()) 150 } 151 152 // NewAuth creates a new instance of Auth. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 153 func NewAuth(t mockConstructorTestingTNewAuth) *Auth { 154 mock := &Auth{} 155 mock.Mock.Test(t) 156 157 t.Cleanup(func() { mock.AssertExpectations(t) }) 158 159 return mock 160 }