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