github.com/goravel/framework@v1.13.9/contracts/http/mocks/ContextRequest.go (about)

     1  // Code generated by mockery v2.33.1. DO NOT EDIT.
     2  
     3  package mocks
     4  
     5  import (
     6  	filesystem "github.com/goravel/framework/contracts/filesystem"
     7  	http "github.com/goravel/framework/contracts/http"
     8  
     9  	mock "github.com/stretchr/testify/mock"
    10  
    11  	nethttp "net/http"
    12  
    13  	validation "github.com/goravel/framework/contracts/validation"
    14  )
    15  
    16  // ContextRequest is an autogenerated mock type for the ContextRequest type
    17  type ContextRequest struct {
    18  	mock.Mock
    19  }
    20  
    21  // AbortWithStatus provides a mock function with given fields: code
    22  func (_m *ContextRequest) AbortWithStatus(code int) {
    23  	_m.Called(code)
    24  }
    25  
    26  // AbortWithStatusJson provides a mock function with given fields: code, jsonObj
    27  func (_m *ContextRequest) AbortWithStatusJson(code int, jsonObj interface{}) {
    28  	_m.Called(code, jsonObj)
    29  }
    30  
    31  // All provides a mock function with given fields:
    32  func (_m *ContextRequest) All() map[string]interface{} {
    33  	ret := _m.Called()
    34  
    35  	var r0 map[string]interface{}
    36  	if rf, ok := ret.Get(0).(func() map[string]interface{}); ok {
    37  		r0 = rf()
    38  	} else {
    39  		if ret.Get(0) != nil {
    40  			r0 = ret.Get(0).(map[string]interface{})
    41  		}
    42  	}
    43  
    44  	return r0
    45  }
    46  
    47  // Bind provides a mock function with given fields: obj
    48  func (_m *ContextRequest) Bind(obj interface{}) error {
    49  	ret := _m.Called(obj)
    50  
    51  	var r0 error
    52  	if rf, ok := ret.Get(0).(func(interface{}) error); ok {
    53  		r0 = rf(obj)
    54  	} else {
    55  		r0 = ret.Error(0)
    56  	}
    57  
    58  	return r0
    59  }
    60  
    61  // File provides a mock function with given fields: name
    62  func (_m *ContextRequest) File(name string) (filesystem.File, error) {
    63  	ret := _m.Called(name)
    64  
    65  	var r0 filesystem.File
    66  	var r1 error
    67  	if rf, ok := ret.Get(0).(func(string) (filesystem.File, error)); ok {
    68  		return rf(name)
    69  	}
    70  	if rf, ok := ret.Get(0).(func(string) filesystem.File); ok {
    71  		r0 = rf(name)
    72  	} else {
    73  		if ret.Get(0) != nil {
    74  			r0 = ret.Get(0).(filesystem.File)
    75  		}
    76  	}
    77  
    78  	if rf, ok := ret.Get(1).(func(string) error); ok {
    79  		r1 = rf(name)
    80  	} else {
    81  		r1 = ret.Error(1)
    82  	}
    83  
    84  	return r0, r1
    85  }
    86  
    87  // FullUrl provides a mock function with given fields:
    88  func (_m *ContextRequest) FullUrl() string {
    89  	ret := _m.Called()
    90  
    91  	var r0 string
    92  	if rf, ok := ret.Get(0).(func() string); ok {
    93  		r0 = rf()
    94  	} else {
    95  		r0 = ret.Get(0).(string)
    96  	}
    97  
    98  	return r0
    99  }
   100  
   101  // Header provides a mock function with given fields: key, defaultValue
   102  func (_m *ContextRequest) Header(key string, defaultValue ...string) string {
   103  	_va := make([]interface{}, len(defaultValue))
   104  	for _i := range defaultValue {
   105  		_va[_i] = defaultValue[_i]
   106  	}
   107  	var _ca []interface{}
   108  	_ca = append(_ca, key)
   109  	_ca = append(_ca, _va...)
   110  	ret := _m.Called(_ca...)
   111  
   112  	var r0 string
   113  	if rf, ok := ret.Get(0).(func(string, ...string) string); ok {
   114  		r0 = rf(key, defaultValue...)
   115  	} else {
   116  		r0 = ret.Get(0).(string)
   117  	}
   118  
   119  	return r0
   120  }
   121  
   122  // Headers provides a mock function with given fields:
   123  func (_m *ContextRequest) Headers() nethttp.Header {
   124  	ret := _m.Called()
   125  
   126  	var r0 nethttp.Header
   127  	if rf, ok := ret.Get(0).(func() nethttp.Header); ok {
   128  		r0 = rf()
   129  	} else {
   130  		if ret.Get(0) != nil {
   131  			r0 = ret.Get(0).(nethttp.Header)
   132  		}
   133  	}
   134  
   135  	return r0
   136  }
   137  
   138  // Host provides a mock function with given fields:
   139  func (_m *ContextRequest) Host() string {
   140  	ret := _m.Called()
   141  
   142  	var r0 string
   143  	if rf, ok := ret.Get(0).(func() string); ok {
   144  		r0 = rf()
   145  	} else {
   146  		r0 = ret.Get(0).(string)
   147  	}
   148  
   149  	return r0
   150  }
   151  
   152  // Input provides a mock function with given fields: key, defaultValue
   153  func (_m *ContextRequest) Input(key string, defaultValue ...string) string {
   154  	_va := make([]interface{}, len(defaultValue))
   155  	for _i := range defaultValue {
   156  		_va[_i] = defaultValue[_i]
   157  	}
   158  	var _ca []interface{}
   159  	_ca = append(_ca, key)
   160  	_ca = append(_ca, _va...)
   161  	ret := _m.Called(_ca...)
   162  
   163  	var r0 string
   164  	if rf, ok := ret.Get(0).(func(string, ...string) string); ok {
   165  		r0 = rf(key, defaultValue...)
   166  	} else {
   167  		r0 = ret.Get(0).(string)
   168  	}
   169  
   170  	return r0
   171  }
   172  
   173  // InputArray provides a mock function with given fields: key, defaultValue
   174  func (_m *ContextRequest) InputArray(key string, defaultValue ...[]string) []string {
   175  	_va := make([]interface{}, len(defaultValue))
   176  	for _i := range defaultValue {
   177  		_va[_i] = defaultValue[_i]
   178  	}
   179  	var _ca []interface{}
   180  	_ca = append(_ca, key)
   181  	_ca = append(_ca, _va...)
   182  	ret := _m.Called(_ca...)
   183  
   184  	var r0 []string
   185  	if rf, ok := ret.Get(0).(func(string, ...[]string) []string); ok {
   186  		r0 = rf(key, defaultValue...)
   187  	} else {
   188  		if ret.Get(0) != nil {
   189  			r0 = ret.Get(0).([]string)
   190  		}
   191  	}
   192  
   193  	return r0
   194  }
   195  
   196  // InputBool provides a mock function with given fields: key, defaultValue
   197  func (_m *ContextRequest) InputBool(key string, defaultValue ...bool) bool {
   198  	_va := make([]interface{}, len(defaultValue))
   199  	for _i := range defaultValue {
   200  		_va[_i] = defaultValue[_i]
   201  	}
   202  	var _ca []interface{}
   203  	_ca = append(_ca, key)
   204  	_ca = append(_ca, _va...)
   205  	ret := _m.Called(_ca...)
   206  
   207  	var r0 bool
   208  	if rf, ok := ret.Get(0).(func(string, ...bool) bool); ok {
   209  		r0 = rf(key, defaultValue...)
   210  	} else {
   211  		r0 = ret.Get(0).(bool)
   212  	}
   213  
   214  	return r0
   215  }
   216  
   217  // InputInt provides a mock function with given fields: key, defaultValue
   218  func (_m *ContextRequest) InputInt(key string, defaultValue ...int) int {
   219  	_va := make([]interface{}, len(defaultValue))
   220  	for _i := range defaultValue {
   221  		_va[_i] = defaultValue[_i]
   222  	}
   223  	var _ca []interface{}
   224  	_ca = append(_ca, key)
   225  	_ca = append(_ca, _va...)
   226  	ret := _m.Called(_ca...)
   227  
   228  	var r0 int
   229  	if rf, ok := ret.Get(0).(func(string, ...int) int); ok {
   230  		r0 = rf(key, defaultValue...)
   231  	} else {
   232  		r0 = ret.Get(0).(int)
   233  	}
   234  
   235  	return r0
   236  }
   237  
   238  // InputInt64 provides a mock function with given fields: key, defaultValue
   239  func (_m *ContextRequest) InputInt64(key string, defaultValue ...int64) int64 {
   240  	_va := make([]interface{}, len(defaultValue))
   241  	for _i := range defaultValue {
   242  		_va[_i] = defaultValue[_i]
   243  	}
   244  	var _ca []interface{}
   245  	_ca = append(_ca, key)
   246  	_ca = append(_ca, _va...)
   247  	ret := _m.Called(_ca...)
   248  
   249  	var r0 int64
   250  	if rf, ok := ret.Get(0).(func(string, ...int64) int64); ok {
   251  		r0 = rf(key, defaultValue...)
   252  	} else {
   253  		r0 = ret.Get(0).(int64)
   254  	}
   255  
   256  	return r0
   257  }
   258  
   259  // InputMap provides a mock function with given fields: key, defaultValue
   260  func (_m *ContextRequest) InputMap(key string, defaultValue ...map[string]string) map[string]string {
   261  	_va := make([]interface{}, len(defaultValue))
   262  	for _i := range defaultValue {
   263  		_va[_i] = defaultValue[_i]
   264  	}
   265  	var _ca []interface{}
   266  	_ca = append(_ca, key)
   267  	_ca = append(_ca, _va...)
   268  	ret := _m.Called(_ca...)
   269  
   270  	var r0 map[string]string
   271  	if rf, ok := ret.Get(0).(func(string, ...map[string]string) map[string]string); ok {
   272  		r0 = rf(key, defaultValue...)
   273  	} else {
   274  		if ret.Get(0) != nil {
   275  			r0 = ret.Get(0).(map[string]string)
   276  		}
   277  	}
   278  
   279  	return r0
   280  }
   281  
   282  // Ip provides a mock function with given fields:
   283  func (_m *ContextRequest) Ip() string {
   284  	ret := _m.Called()
   285  
   286  	var r0 string
   287  	if rf, ok := ret.Get(0).(func() string); ok {
   288  		r0 = rf()
   289  	} else {
   290  		r0 = ret.Get(0).(string)
   291  	}
   292  
   293  	return r0
   294  }
   295  
   296  // Method provides a mock function with given fields:
   297  func (_m *ContextRequest) Method() string {
   298  	ret := _m.Called()
   299  
   300  	var r0 string
   301  	if rf, ok := ret.Get(0).(func() string); ok {
   302  		r0 = rf()
   303  	} else {
   304  		r0 = ret.Get(0).(string)
   305  	}
   306  
   307  	return r0
   308  }
   309  
   310  // Next provides a mock function with given fields:
   311  func (_m *ContextRequest) Next() {
   312  	_m.Called()
   313  }
   314  
   315  // Origin provides a mock function with given fields:
   316  func (_m *ContextRequest) Origin() *nethttp.Request {
   317  	ret := _m.Called()
   318  
   319  	var r0 *nethttp.Request
   320  	if rf, ok := ret.Get(0).(func() *nethttp.Request); ok {
   321  		r0 = rf()
   322  	} else {
   323  		if ret.Get(0) != nil {
   324  			r0 = ret.Get(0).(*nethttp.Request)
   325  		}
   326  	}
   327  
   328  	return r0
   329  }
   330  
   331  // Path provides a mock function with given fields:
   332  func (_m *ContextRequest) Path() string {
   333  	ret := _m.Called()
   334  
   335  	var r0 string
   336  	if rf, ok := ret.Get(0).(func() string); ok {
   337  		r0 = rf()
   338  	} else {
   339  		r0 = ret.Get(0).(string)
   340  	}
   341  
   342  	return r0
   343  }
   344  
   345  // Queries provides a mock function with given fields:
   346  func (_m *ContextRequest) Queries() map[string]string {
   347  	ret := _m.Called()
   348  
   349  	var r0 map[string]string
   350  	if rf, ok := ret.Get(0).(func() map[string]string); ok {
   351  		r0 = rf()
   352  	} else {
   353  		if ret.Get(0) != nil {
   354  			r0 = ret.Get(0).(map[string]string)
   355  		}
   356  	}
   357  
   358  	return r0
   359  }
   360  
   361  // Query provides a mock function with given fields: key, defaultValue
   362  func (_m *ContextRequest) Query(key string, defaultValue ...string) string {
   363  	_va := make([]interface{}, len(defaultValue))
   364  	for _i := range defaultValue {
   365  		_va[_i] = defaultValue[_i]
   366  	}
   367  	var _ca []interface{}
   368  	_ca = append(_ca, key)
   369  	_ca = append(_ca, _va...)
   370  	ret := _m.Called(_ca...)
   371  
   372  	var r0 string
   373  	if rf, ok := ret.Get(0).(func(string, ...string) string); ok {
   374  		r0 = rf(key, defaultValue...)
   375  	} else {
   376  		r0 = ret.Get(0).(string)
   377  	}
   378  
   379  	return r0
   380  }
   381  
   382  // QueryArray provides a mock function with given fields: key
   383  func (_m *ContextRequest) QueryArray(key string) []string {
   384  	ret := _m.Called(key)
   385  
   386  	var r0 []string
   387  	if rf, ok := ret.Get(0).(func(string) []string); ok {
   388  		r0 = rf(key)
   389  	} else {
   390  		if ret.Get(0) != nil {
   391  			r0 = ret.Get(0).([]string)
   392  		}
   393  	}
   394  
   395  	return r0
   396  }
   397  
   398  // QueryBool provides a mock function with given fields: key, defaultValue
   399  func (_m *ContextRequest) QueryBool(key string, defaultValue ...bool) bool {
   400  	_va := make([]interface{}, len(defaultValue))
   401  	for _i := range defaultValue {
   402  		_va[_i] = defaultValue[_i]
   403  	}
   404  	var _ca []interface{}
   405  	_ca = append(_ca, key)
   406  	_ca = append(_ca, _va...)
   407  	ret := _m.Called(_ca...)
   408  
   409  	var r0 bool
   410  	if rf, ok := ret.Get(0).(func(string, ...bool) bool); ok {
   411  		r0 = rf(key, defaultValue...)
   412  	} else {
   413  		r0 = ret.Get(0).(bool)
   414  	}
   415  
   416  	return r0
   417  }
   418  
   419  // QueryInt provides a mock function with given fields: key, defaultValue
   420  func (_m *ContextRequest) QueryInt(key string, defaultValue ...int) int {
   421  	_va := make([]interface{}, len(defaultValue))
   422  	for _i := range defaultValue {
   423  		_va[_i] = defaultValue[_i]
   424  	}
   425  	var _ca []interface{}
   426  	_ca = append(_ca, key)
   427  	_ca = append(_ca, _va...)
   428  	ret := _m.Called(_ca...)
   429  
   430  	var r0 int
   431  	if rf, ok := ret.Get(0).(func(string, ...int) int); ok {
   432  		r0 = rf(key, defaultValue...)
   433  	} else {
   434  		r0 = ret.Get(0).(int)
   435  	}
   436  
   437  	return r0
   438  }
   439  
   440  // QueryInt64 provides a mock function with given fields: key, defaultValue
   441  func (_m *ContextRequest) QueryInt64(key string, defaultValue ...int64) int64 {
   442  	_va := make([]interface{}, len(defaultValue))
   443  	for _i := range defaultValue {
   444  		_va[_i] = defaultValue[_i]
   445  	}
   446  	var _ca []interface{}
   447  	_ca = append(_ca, key)
   448  	_ca = append(_ca, _va...)
   449  	ret := _m.Called(_ca...)
   450  
   451  	var r0 int64
   452  	if rf, ok := ret.Get(0).(func(string, ...int64) int64); ok {
   453  		r0 = rf(key, defaultValue...)
   454  	} else {
   455  		r0 = ret.Get(0).(int64)
   456  	}
   457  
   458  	return r0
   459  }
   460  
   461  // QueryMap provides a mock function with given fields: key
   462  func (_m *ContextRequest) QueryMap(key string) map[string]string {
   463  	ret := _m.Called(key)
   464  
   465  	var r0 map[string]string
   466  	if rf, ok := ret.Get(0).(func(string) map[string]string); ok {
   467  		r0 = rf(key)
   468  	} else {
   469  		if ret.Get(0) != nil {
   470  			r0 = ret.Get(0).(map[string]string)
   471  		}
   472  	}
   473  
   474  	return r0
   475  }
   476  
   477  // Route provides a mock function with given fields: key
   478  func (_m *ContextRequest) Route(key string) string {
   479  	ret := _m.Called(key)
   480  
   481  	var r0 string
   482  	if rf, ok := ret.Get(0).(func(string) string); ok {
   483  		r0 = rf(key)
   484  	} else {
   485  		r0 = ret.Get(0).(string)
   486  	}
   487  
   488  	return r0
   489  }
   490  
   491  // RouteInt provides a mock function with given fields: key
   492  func (_m *ContextRequest) RouteInt(key string) int {
   493  	ret := _m.Called(key)
   494  
   495  	var r0 int
   496  	if rf, ok := ret.Get(0).(func(string) int); ok {
   497  		r0 = rf(key)
   498  	} else {
   499  		r0 = ret.Get(0).(int)
   500  	}
   501  
   502  	return r0
   503  }
   504  
   505  // RouteInt64 provides a mock function with given fields: key
   506  func (_m *ContextRequest) RouteInt64(key string) int64 {
   507  	ret := _m.Called(key)
   508  
   509  	var r0 int64
   510  	if rf, ok := ret.Get(0).(func(string) int64); ok {
   511  		r0 = rf(key)
   512  	} else {
   513  		r0 = ret.Get(0).(int64)
   514  	}
   515  
   516  	return r0
   517  }
   518  
   519  // Url provides a mock function with given fields:
   520  func (_m *ContextRequest) Url() string {
   521  	ret := _m.Called()
   522  
   523  	var r0 string
   524  	if rf, ok := ret.Get(0).(func() string); ok {
   525  		r0 = rf()
   526  	} else {
   527  		r0 = ret.Get(0).(string)
   528  	}
   529  
   530  	return r0
   531  }
   532  
   533  // Validate provides a mock function with given fields: rules, options
   534  func (_m *ContextRequest) Validate(rules map[string]string, options ...validation.Option) (validation.Validator, error) {
   535  	_va := make([]interface{}, len(options))
   536  	for _i := range options {
   537  		_va[_i] = options[_i]
   538  	}
   539  	var _ca []interface{}
   540  	_ca = append(_ca, rules)
   541  	_ca = append(_ca, _va...)
   542  	ret := _m.Called(_ca...)
   543  
   544  	var r0 validation.Validator
   545  	var r1 error
   546  	if rf, ok := ret.Get(0).(func(map[string]string, ...validation.Option) (validation.Validator, error)); ok {
   547  		return rf(rules, options...)
   548  	}
   549  	if rf, ok := ret.Get(0).(func(map[string]string, ...validation.Option) validation.Validator); ok {
   550  		r0 = rf(rules, options...)
   551  	} else {
   552  		if ret.Get(0) != nil {
   553  			r0 = ret.Get(0).(validation.Validator)
   554  		}
   555  	}
   556  
   557  	if rf, ok := ret.Get(1).(func(map[string]string, ...validation.Option) error); ok {
   558  		r1 = rf(rules, options...)
   559  	} else {
   560  		r1 = ret.Error(1)
   561  	}
   562  
   563  	return r0, r1
   564  }
   565  
   566  // ValidateRequest provides a mock function with given fields: request
   567  func (_m *ContextRequest) ValidateRequest(request http.FormRequest) (validation.Errors, error) {
   568  	ret := _m.Called(request)
   569  
   570  	var r0 validation.Errors
   571  	var r1 error
   572  	if rf, ok := ret.Get(0).(func(http.FormRequest) (validation.Errors, error)); ok {
   573  		return rf(request)
   574  	}
   575  	if rf, ok := ret.Get(0).(func(http.FormRequest) validation.Errors); ok {
   576  		r0 = rf(request)
   577  	} else {
   578  		if ret.Get(0) != nil {
   579  			r0 = ret.Get(0).(validation.Errors)
   580  		}
   581  	}
   582  
   583  	if rf, ok := ret.Get(1).(func(http.FormRequest) error); ok {
   584  		r1 = rf(request)
   585  	} else {
   586  		r1 = ret.Error(1)
   587  	}
   588  
   589  	return r0, r1
   590  }
   591  
   592  // NewContextRequest creates a new instance of ContextRequest. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   593  // The first argument is typically a *testing.T value.
   594  func NewContextRequest(t interface {
   595  	mock.TestingT
   596  	Cleanup(func())
   597  }) *ContextRequest {
   598  	mock := &ContextRequest{}
   599  	mock.Mock.Test(t)
   600  
   601  	t.Cleanup(func() { mock.AssertExpectations(t) })
   602  
   603  	return mock
   604  }