github.com/goravel/framework@v1.13.9/contracts/filesystem/mocks/Driver.go (about)

     1  // Code generated by mockery v2.33.2. DO NOT EDIT.
     2  
     3  package mocks
     4  
     5  import (
     6  	context "context"
     7  
     8  	filesystem "github.com/goravel/framework/contracts/filesystem"
     9  	mock "github.com/stretchr/testify/mock"
    10  
    11  	time "time"
    12  )
    13  
    14  // Driver is an autogenerated mock type for the Driver type
    15  type Driver struct {
    16  	mock.Mock
    17  }
    18  
    19  // AllDirectories provides a mock function with given fields: path
    20  func (_m *Driver) AllDirectories(path string) ([]string, error) {
    21  	ret := _m.Called(path)
    22  
    23  	var r0 []string
    24  	var r1 error
    25  	if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok {
    26  		return rf(path)
    27  	}
    28  	if rf, ok := ret.Get(0).(func(string) []string); ok {
    29  		r0 = rf(path)
    30  	} else {
    31  		if ret.Get(0) != nil {
    32  			r0 = ret.Get(0).([]string)
    33  		}
    34  	}
    35  
    36  	if rf, ok := ret.Get(1).(func(string) error); ok {
    37  		r1 = rf(path)
    38  	} else {
    39  		r1 = ret.Error(1)
    40  	}
    41  
    42  	return r0, r1
    43  }
    44  
    45  // AllFiles provides a mock function with given fields: path
    46  func (_m *Driver) AllFiles(path string) ([]string, error) {
    47  	ret := _m.Called(path)
    48  
    49  	var r0 []string
    50  	var r1 error
    51  	if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok {
    52  		return rf(path)
    53  	}
    54  	if rf, ok := ret.Get(0).(func(string) []string); ok {
    55  		r0 = rf(path)
    56  	} else {
    57  		if ret.Get(0) != nil {
    58  			r0 = ret.Get(0).([]string)
    59  		}
    60  	}
    61  
    62  	if rf, ok := ret.Get(1).(func(string) error); ok {
    63  		r1 = rf(path)
    64  	} else {
    65  		r1 = ret.Error(1)
    66  	}
    67  
    68  	return r0, r1
    69  }
    70  
    71  // Copy provides a mock function with given fields: oldFile, newFile
    72  func (_m *Driver) Copy(oldFile string, newFile string) error {
    73  	ret := _m.Called(oldFile, newFile)
    74  
    75  	var r0 error
    76  	if rf, ok := ret.Get(0).(func(string, string) error); ok {
    77  		r0 = rf(oldFile, newFile)
    78  	} else {
    79  		r0 = ret.Error(0)
    80  	}
    81  
    82  	return r0
    83  }
    84  
    85  // Delete provides a mock function with given fields: file
    86  func (_m *Driver) Delete(file ...string) error {
    87  	_va := make([]interface{}, len(file))
    88  	for _i := range file {
    89  		_va[_i] = file[_i]
    90  	}
    91  	var _ca []interface{}
    92  	_ca = append(_ca, _va...)
    93  	ret := _m.Called(_ca...)
    94  
    95  	var r0 error
    96  	if rf, ok := ret.Get(0).(func(...string) error); ok {
    97  		r0 = rf(file...)
    98  	} else {
    99  		r0 = ret.Error(0)
   100  	}
   101  
   102  	return r0
   103  }
   104  
   105  // DeleteDirectory provides a mock function with given fields: directory
   106  func (_m *Driver) DeleteDirectory(directory string) error {
   107  	ret := _m.Called(directory)
   108  
   109  	var r0 error
   110  	if rf, ok := ret.Get(0).(func(string) error); ok {
   111  		r0 = rf(directory)
   112  	} else {
   113  		r0 = ret.Error(0)
   114  	}
   115  
   116  	return r0
   117  }
   118  
   119  // Directories provides a mock function with given fields: path
   120  func (_m *Driver) Directories(path string) ([]string, error) {
   121  	ret := _m.Called(path)
   122  
   123  	var r0 []string
   124  	var r1 error
   125  	if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok {
   126  		return rf(path)
   127  	}
   128  	if rf, ok := ret.Get(0).(func(string) []string); ok {
   129  		r0 = rf(path)
   130  	} else {
   131  		if ret.Get(0) != nil {
   132  			r0 = ret.Get(0).([]string)
   133  		}
   134  	}
   135  
   136  	if rf, ok := ret.Get(1).(func(string) error); ok {
   137  		r1 = rf(path)
   138  	} else {
   139  		r1 = ret.Error(1)
   140  	}
   141  
   142  	return r0, r1
   143  }
   144  
   145  // Exists provides a mock function with given fields: file
   146  func (_m *Driver) Exists(file string) bool {
   147  	ret := _m.Called(file)
   148  
   149  	var r0 bool
   150  	if rf, ok := ret.Get(0).(func(string) bool); ok {
   151  		r0 = rf(file)
   152  	} else {
   153  		r0 = ret.Get(0).(bool)
   154  	}
   155  
   156  	return r0
   157  }
   158  
   159  // Files provides a mock function with given fields: path
   160  func (_m *Driver) Files(path string) ([]string, error) {
   161  	ret := _m.Called(path)
   162  
   163  	var r0 []string
   164  	var r1 error
   165  	if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok {
   166  		return rf(path)
   167  	}
   168  	if rf, ok := ret.Get(0).(func(string) []string); ok {
   169  		r0 = rf(path)
   170  	} else {
   171  		if ret.Get(0) != nil {
   172  			r0 = ret.Get(0).([]string)
   173  		}
   174  	}
   175  
   176  	if rf, ok := ret.Get(1).(func(string) error); ok {
   177  		r1 = rf(path)
   178  	} else {
   179  		r1 = ret.Error(1)
   180  	}
   181  
   182  	return r0, r1
   183  }
   184  
   185  // Get provides a mock function with given fields: file
   186  func (_m *Driver) Get(file string) (string, error) {
   187  	ret := _m.Called(file)
   188  
   189  	var r0 string
   190  	var r1 error
   191  	if rf, ok := ret.Get(0).(func(string) (string, error)); ok {
   192  		return rf(file)
   193  	}
   194  	if rf, ok := ret.Get(0).(func(string) string); ok {
   195  		r0 = rf(file)
   196  	} else {
   197  		r0 = ret.Get(0).(string)
   198  	}
   199  
   200  	if rf, ok := ret.Get(1).(func(string) error); ok {
   201  		r1 = rf(file)
   202  	} else {
   203  		r1 = ret.Error(1)
   204  	}
   205  
   206  	return r0, r1
   207  }
   208  
   209  // GetBytes provides a mock function with given fields: file
   210  func (_m *Driver) GetBytes(file string) ([]byte, error) {
   211  	ret := _m.Called(file)
   212  
   213  	var r0 []byte
   214  	var r1 error
   215  	if rf, ok := ret.Get(0).(func(string) ([]byte, error)); ok {
   216  		return rf(file)
   217  	}
   218  	if rf, ok := ret.Get(0).(func(string) []byte); ok {
   219  		r0 = rf(file)
   220  	} else {
   221  		if ret.Get(0) != nil {
   222  			r0 = ret.Get(0).([]byte)
   223  		}
   224  	}
   225  
   226  	if rf, ok := ret.Get(1).(func(string) error); ok {
   227  		r1 = rf(file)
   228  	} else {
   229  		r1 = ret.Error(1)
   230  	}
   231  
   232  	return r0, r1
   233  }
   234  
   235  // LastModified provides a mock function with given fields: file
   236  func (_m *Driver) LastModified(file string) (time.Time, error) {
   237  	ret := _m.Called(file)
   238  
   239  	var r0 time.Time
   240  	var r1 error
   241  	if rf, ok := ret.Get(0).(func(string) (time.Time, error)); ok {
   242  		return rf(file)
   243  	}
   244  	if rf, ok := ret.Get(0).(func(string) time.Time); ok {
   245  		r0 = rf(file)
   246  	} else {
   247  		r0 = ret.Get(0).(time.Time)
   248  	}
   249  
   250  	if rf, ok := ret.Get(1).(func(string) error); ok {
   251  		r1 = rf(file)
   252  	} else {
   253  		r1 = ret.Error(1)
   254  	}
   255  
   256  	return r0, r1
   257  }
   258  
   259  // MakeDirectory provides a mock function with given fields: directory
   260  func (_m *Driver) MakeDirectory(directory string) error {
   261  	ret := _m.Called(directory)
   262  
   263  	var r0 error
   264  	if rf, ok := ret.Get(0).(func(string) error); ok {
   265  		r0 = rf(directory)
   266  	} else {
   267  		r0 = ret.Error(0)
   268  	}
   269  
   270  	return r0
   271  }
   272  
   273  // MimeType provides a mock function with given fields: file
   274  func (_m *Driver) MimeType(file string) (string, error) {
   275  	ret := _m.Called(file)
   276  
   277  	var r0 string
   278  	var r1 error
   279  	if rf, ok := ret.Get(0).(func(string) (string, error)); ok {
   280  		return rf(file)
   281  	}
   282  	if rf, ok := ret.Get(0).(func(string) string); ok {
   283  		r0 = rf(file)
   284  	} else {
   285  		r0 = ret.Get(0).(string)
   286  	}
   287  
   288  	if rf, ok := ret.Get(1).(func(string) error); ok {
   289  		r1 = rf(file)
   290  	} else {
   291  		r1 = ret.Error(1)
   292  	}
   293  
   294  	return r0, r1
   295  }
   296  
   297  // Missing provides a mock function with given fields: file
   298  func (_m *Driver) Missing(file string) bool {
   299  	ret := _m.Called(file)
   300  
   301  	var r0 bool
   302  	if rf, ok := ret.Get(0).(func(string) bool); ok {
   303  		r0 = rf(file)
   304  	} else {
   305  		r0 = ret.Get(0).(bool)
   306  	}
   307  
   308  	return r0
   309  }
   310  
   311  // Move provides a mock function with given fields: oldFile, newFile
   312  func (_m *Driver) Move(oldFile string, newFile string) error {
   313  	ret := _m.Called(oldFile, newFile)
   314  
   315  	var r0 error
   316  	if rf, ok := ret.Get(0).(func(string, string) error); ok {
   317  		r0 = rf(oldFile, newFile)
   318  	} else {
   319  		r0 = ret.Error(0)
   320  	}
   321  
   322  	return r0
   323  }
   324  
   325  // Path provides a mock function with given fields: file
   326  func (_m *Driver) Path(file string) string {
   327  	ret := _m.Called(file)
   328  
   329  	var r0 string
   330  	if rf, ok := ret.Get(0).(func(string) string); ok {
   331  		r0 = rf(file)
   332  	} else {
   333  		r0 = ret.Get(0).(string)
   334  	}
   335  
   336  	return r0
   337  }
   338  
   339  // Put provides a mock function with given fields: file, content
   340  func (_m *Driver) Put(file string, content string) error {
   341  	ret := _m.Called(file, content)
   342  
   343  	var r0 error
   344  	if rf, ok := ret.Get(0).(func(string, string) error); ok {
   345  		r0 = rf(file, content)
   346  	} else {
   347  		r0 = ret.Error(0)
   348  	}
   349  
   350  	return r0
   351  }
   352  
   353  // PutFile provides a mock function with given fields: path, source
   354  func (_m *Driver) PutFile(path string, source filesystem.File) (string, error) {
   355  	ret := _m.Called(path, source)
   356  
   357  	var r0 string
   358  	var r1 error
   359  	if rf, ok := ret.Get(0).(func(string, filesystem.File) (string, error)); ok {
   360  		return rf(path, source)
   361  	}
   362  	if rf, ok := ret.Get(0).(func(string, filesystem.File) string); ok {
   363  		r0 = rf(path, source)
   364  	} else {
   365  		r0 = ret.Get(0).(string)
   366  	}
   367  
   368  	if rf, ok := ret.Get(1).(func(string, filesystem.File) error); ok {
   369  		r1 = rf(path, source)
   370  	} else {
   371  		r1 = ret.Error(1)
   372  	}
   373  
   374  	return r0, r1
   375  }
   376  
   377  // PutFileAs provides a mock function with given fields: path, source, name
   378  func (_m *Driver) PutFileAs(path string, source filesystem.File, name string) (string, error) {
   379  	ret := _m.Called(path, source, name)
   380  
   381  	var r0 string
   382  	var r1 error
   383  	if rf, ok := ret.Get(0).(func(string, filesystem.File, string) (string, error)); ok {
   384  		return rf(path, source, name)
   385  	}
   386  	if rf, ok := ret.Get(0).(func(string, filesystem.File, string) string); ok {
   387  		r0 = rf(path, source, name)
   388  	} else {
   389  		r0 = ret.Get(0).(string)
   390  	}
   391  
   392  	if rf, ok := ret.Get(1).(func(string, filesystem.File, string) error); ok {
   393  		r1 = rf(path, source, name)
   394  	} else {
   395  		r1 = ret.Error(1)
   396  	}
   397  
   398  	return r0, r1
   399  }
   400  
   401  // Size provides a mock function with given fields: file
   402  func (_m *Driver) Size(file string) (int64, error) {
   403  	ret := _m.Called(file)
   404  
   405  	var r0 int64
   406  	var r1 error
   407  	if rf, ok := ret.Get(0).(func(string) (int64, error)); ok {
   408  		return rf(file)
   409  	}
   410  	if rf, ok := ret.Get(0).(func(string) int64); ok {
   411  		r0 = rf(file)
   412  	} else {
   413  		r0 = ret.Get(0).(int64)
   414  	}
   415  
   416  	if rf, ok := ret.Get(1).(func(string) error); ok {
   417  		r1 = rf(file)
   418  	} else {
   419  		r1 = ret.Error(1)
   420  	}
   421  
   422  	return r0, r1
   423  }
   424  
   425  // TemporaryUrl provides a mock function with given fields: file, _a1
   426  func (_m *Driver) TemporaryUrl(file string, _a1 time.Time) (string, error) {
   427  	ret := _m.Called(file, _a1)
   428  
   429  	var r0 string
   430  	var r1 error
   431  	if rf, ok := ret.Get(0).(func(string, time.Time) (string, error)); ok {
   432  		return rf(file, _a1)
   433  	}
   434  	if rf, ok := ret.Get(0).(func(string, time.Time) string); ok {
   435  		r0 = rf(file, _a1)
   436  	} else {
   437  		r0 = ret.Get(0).(string)
   438  	}
   439  
   440  	if rf, ok := ret.Get(1).(func(string, time.Time) error); ok {
   441  		r1 = rf(file, _a1)
   442  	} else {
   443  		r1 = ret.Error(1)
   444  	}
   445  
   446  	return r0, r1
   447  }
   448  
   449  // Url provides a mock function with given fields: file
   450  func (_m *Driver) Url(file string) string {
   451  	ret := _m.Called(file)
   452  
   453  	var r0 string
   454  	if rf, ok := ret.Get(0).(func(string) string); ok {
   455  		r0 = rf(file)
   456  	} else {
   457  		r0 = ret.Get(0).(string)
   458  	}
   459  
   460  	return r0
   461  }
   462  
   463  // WithContext provides a mock function with given fields: ctx
   464  func (_m *Driver) WithContext(ctx context.Context) filesystem.Driver {
   465  	ret := _m.Called(ctx)
   466  
   467  	var r0 filesystem.Driver
   468  	if rf, ok := ret.Get(0).(func(context.Context) filesystem.Driver); ok {
   469  		r0 = rf(ctx)
   470  	} else {
   471  		if ret.Get(0) != nil {
   472  			r0 = ret.Get(0).(filesystem.Driver)
   473  		}
   474  	}
   475  
   476  	return r0
   477  }
   478  
   479  // NewDriver creates a new instance of Driver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   480  // The first argument is typically a *testing.T value.
   481  func NewDriver(t interface {
   482  	mock.TestingT
   483  	Cleanup(func())
   484  }) *Driver {
   485  	mock := &Driver{}
   486  	mock.Mock.Test(t)
   487  
   488  	t.Cleanup(func() { mock.AssertExpectations(t) })
   489  
   490  	return mock
   491  }