github.com/goravel/framework@v1.13.9/contracts/validation/mocks/Validation.go (about)

     1  // Code generated by mockery v2.14.0. DO NOT EDIT.
     2  
     3  package mocks
     4  
     5  import (
     6  	validation "github.com/goravel/framework/contracts/validation"
     7  	mock "github.com/stretchr/testify/mock"
     8  )
     9  
    10  // Validation is an autogenerated mock type for the Validation type
    11  type Validation struct {
    12  	mock.Mock
    13  }
    14  
    15  // AddRules provides a mock function with given fields: _a0
    16  func (_m *Validation) AddRules(_a0 []validation.Rule) error {
    17  	ret := _m.Called(_a0)
    18  
    19  	var r0 error
    20  	if rf, ok := ret.Get(0).(func([]validation.Rule) error); ok {
    21  		r0 = rf(_a0)
    22  	} else {
    23  		r0 = ret.Error(0)
    24  	}
    25  
    26  	return r0
    27  }
    28  
    29  // Make provides a mock function with given fields: data, rules, options
    30  func (_m *Validation) Make(data interface{}, rules map[string]string, options ...validation.Option) (validation.Validator, error) {
    31  	_va := make([]interface{}, len(options))
    32  	for _i := range options {
    33  		_va[_i] = options[_i]
    34  	}
    35  	var _ca []interface{}
    36  	_ca = append(_ca, data, rules)
    37  	_ca = append(_ca, _va...)
    38  	ret := _m.Called(_ca...)
    39  
    40  	var r0 validation.Validator
    41  	if rf, ok := ret.Get(0).(func(interface{}, map[string]string, ...validation.Option) validation.Validator); ok {
    42  		r0 = rf(data, rules, options...)
    43  	} else {
    44  		if ret.Get(0) != nil {
    45  			r0 = ret.Get(0).(validation.Validator)
    46  		}
    47  	}
    48  
    49  	var r1 error
    50  	if rf, ok := ret.Get(1).(func(interface{}, map[string]string, ...validation.Option) error); ok {
    51  		r1 = rf(data, rules, options...)
    52  	} else {
    53  		r1 = ret.Error(1)
    54  	}
    55  
    56  	return r0, r1
    57  }
    58  
    59  // Rules provides a mock function with given fields:
    60  func (_m *Validation) Rules() []validation.Rule {
    61  	ret := _m.Called()
    62  
    63  	var r0 []validation.Rule
    64  	if rf, ok := ret.Get(0).(func() []validation.Rule); ok {
    65  		r0 = rf()
    66  	} else {
    67  		if ret.Get(0) != nil {
    68  			r0 = ret.Get(0).([]validation.Rule)
    69  		}
    70  	}
    71  
    72  	return r0
    73  }
    74  
    75  type mockConstructorTestingTNewValidation interface {
    76  	mock.TestingT
    77  	Cleanup(func())
    78  }
    79  
    80  // NewValidation creates a new instance of Validation. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
    81  func NewValidation(t mockConstructorTestingTNewValidation) *Validation {
    82  	mock := &Validation{}
    83  	mock.Mock.Test(t)
    84  
    85  	t.Cleanup(func() { mock.AssertExpectations(t) })
    86  
    87  	return mock
    88  }