github.com/goravel/framework@v1.13.9/contracts/filesystem/mocks/Storage.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 // Storage is an autogenerated mock type for the Storage type 15 type Storage struct { 16 mock.Mock 17 } 18 19 // AllDirectories provides a mock function with given fields: path 20 func (_m *Storage) 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 *Storage) 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 *Storage) 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 *Storage) 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 *Storage) 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 *Storage) 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 // Disk provides a mock function with given fields: disk 146 func (_m *Storage) Disk(disk string) filesystem.Driver { 147 ret := _m.Called(disk) 148 149 var r0 filesystem.Driver 150 if rf, ok := ret.Get(0).(func(string) filesystem.Driver); ok { 151 r0 = rf(disk) 152 } else { 153 if ret.Get(0) != nil { 154 r0 = ret.Get(0).(filesystem.Driver) 155 } 156 } 157 158 return r0 159 } 160 161 // Exists provides a mock function with given fields: file 162 func (_m *Storage) Exists(file string) bool { 163 ret := _m.Called(file) 164 165 var r0 bool 166 if rf, ok := ret.Get(0).(func(string) bool); ok { 167 r0 = rf(file) 168 } else { 169 r0 = ret.Get(0).(bool) 170 } 171 172 return r0 173 } 174 175 // Files provides a mock function with given fields: path 176 func (_m *Storage) Files(path string) ([]string, error) { 177 ret := _m.Called(path) 178 179 var r0 []string 180 var r1 error 181 if rf, ok := ret.Get(0).(func(string) ([]string, error)); ok { 182 return rf(path) 183 } 184 if rf, ok := ret.Get(0).(func(string) []string); ok { 185 r0 = rf(path) 186 } else { 187 if ret.Get(0) != nil { 188 r0 = ret.Get(0).([]string) 189 } 190 } 191 192 if rf, ok := ret.Get(1).(func(string) error); ok { 193 r1 = rf(path) 194 } else { 195 r1 = ret.Error(1) 196 } 197 198 return r0, r1 199 } 200 201 // Get provides a mock function with given fields: file 202 func (_m *Storage) Get(file string) (string, error) { 203 ret := _m.Called(file) 204 205 var r0 string 206 var r1 error 207 if rf, ok := ret.Get(0).(func(string) (string, error)); ok { 208 return rf(file) 209 } 210 if rf, ok := ret.Get(0).(func(string) string); ok { 211 r0 = rf(file) 212 } else { 213 r0 = ret.Get(0).(string) 214 } 215 216 if rf, ok := ret.Get(1).(func(string) error); ok { 217 r1 = rf(file) 218 } else { 219 r1 = ret.Error(1) 220 } 221 222 return r0, r1 223 } 224 225 // GetBytes provides a mock function with given fields: file 226 func (_m *Storage) GetBytes(file string) ([]byte, error) { 227 ret := _m.Called(file) 228 229 var r0 []byte 230 var r1 error 231 if rf, ok := ret.Get(0).(func(string) ([]byte, error)); ok { 232 return rf(file) 233 } 234 if rf, ok := ret.Get(0).(func(string) []byte); ok { 235 r0 = rf(file) 236 } else { 237 if ret.Get(0) != nil { 238 r0 = ret.Get(0).([]byte) 239 } 240 } 241 242 if rf, ok := ret.Get(1).(func(string) error); ok { 243 r1 = rf(file) 244 } else { 245 r1 = ret.Error(1) 246 } 247 248 return r0, r1 249 } 250 251 // LastModified provides a mock function with given fields: file 252 func (_m *Storage) LastModified(file string) (time.Time, error) { 253 ret := _m.Called(file) 254 255 var r0 time.Time 256 var r1 error 257 if rf, ok := ret.Get(0).(func(string) (time.Time, error)); ok { 258 return rf(file) 259 } 260 if rf, ok := ret.Get(0).(func(string) time.Time); ok { 261 r0 = rf(file) 262 } else { 263 r0 = ret.Get(0).(time.Time) 264 } 265 266 if rf, ok := ret.Get(1).(func(string) error); ok { 267 r1 = rf(file) 268 } else { 269 r1 = ret.Error(1) 270 } 271 272 return r0, r1 273 } 274 275 // MakeDirectory provides a mock function with given fields: directory 276 func (_m *Storage) MakeDirectory(directory string) error { 277 ret := _m.Called(directory) 278 279 var r0 error 280 if rf, ok := ret.Get(0).(func(string) error); ok { 281 r0 = rf(directory) 282 } else { 283 r0 = ret.Error(0) 284 } 285 286 return r0 287 } 288 289 // MimeType provides a mock function with given fields: file 290 func (_m *Storage) MimeType(file string) (string, error) { 291 ret := _m.Called(file) 292 293 var r0 string 294 var r1 error 295 if rf, ok := ret.Get(0).(func(string) (string, error)); ok { 296 return rf(file) 297 } 298 if rf, ok := ret.Get(0).(func(string) string); ok { 299 r0 = rf(file) 300 } else { 301 r0 = ret.Get(0).(string) 302 } 303 304 if rf, ok := ret.Get(1).(func(string) error); ok { 305 r1 = rf(file) 306 } else { 307 r1 = ret.Error(1) 308 } 309 310 return r0, r1 311 } 312 313 // Missing provides a mock function with given fields: file 314 func (_m *Storage) Missing(file string) bool { 315 ret := _m.Called(file) 316 317 var r0 bool 318 if rf, ok := ret.Get(0).(func(string) bool); ok { 319 r0 = rf(file) 320 } else { 321 r0 = ret.Get(0).(bool) 322 } 323 324 return r0 325 } 326 327 // Move provides a mock function with given fields: oldFile, newFile 328 func (_m *Storage) Move(oldFile string, newFile string) error { 329 ret := _m.Called(oldFile, newFile) 330 331 var r0 error 332 if rf, ok := ret.Get(0).(func(string, string) error); ok { 333 r0 = rf(oldFile, newFile) 334 } else { 335 r0 = ret.Error(0) 336 } 337 338 return r0 339 } 340 341 // Path provides a mock function with given fields: file 342 func (_m *Storage) Path(file string) string { 343 ret := _m.Called(file) 344 345 var r0 string 346 if rf, ok := ret.Get(0).(func(string) string); ok { 347 r0 = rf(file) 348 } else { 349 r0 = ret.Get(0).(string) 350 } 351 352 return r0 353 } 354 355 // Put provides a mock function with given fields: file, content 356 func (_m *Storage) Put(file string, content string) error { 357 ret := _m.Called(file, content) 358 359 var r0 error 360 if rf, ok := ret.Get(0).(func(string, string) error); ok { 361 r0 = rf(file, content) 362 } else { 363 r0 = ret.Error(0) 364 } 365 366 return r0 367 } 368 369 // PutFile provides a mock function with given fields: path, source 370 func (_m *Storage) PutFile(path string, source filesystem.File) (string, error) { 371 ret := _m.Called(path, source) 372 373 var r0 string 374 var r1 error 375 if rf, ok := ret.Get(0).(func(string, filesystem.File) (string, error)); ok { 376 return rf(path, source) 377 } 378 if rf, ok := ret.Get(0).(func(string, filesystem.File) string); ok { 379 r0 = rf(path, source) 380 } else { 381 r0 = ret.Get(0).(string) 382 } 383 384 if rf, ok := ret.Get(1).(func(string, filesystem.File) error); ok { 385 r1 = rf(path, source) 386 } else { 387 r1 = ret.Error(1) 388 } 389 390 return r0, r1 391 } 392 393 // PutFileAs provides a mock function with given fields: path, source, name 394 func (_m *Storage) PutFileAs(path string, source filesystem.File, name string) (string, error) { 395 ret := _m.Called(path, source, name) 396 397 var r0 string 398 var r1 error 399 if rf, ok := ret.Get(0).(func(string, filesystem.File, string) (string, error)); ok { 400 return rf(path, source, name) 401 } 402 if rf, ok := ret.Get(0).(func(string, filesystem.File, string) string); ok { 403 r0 = rf(path, source, name) 404 } else { 405 r0 = ret.Get(0).(string) 406 } 407 408 if rf, ok := ret.Get(1).(func(string, filesystem.File, string) error); ok { 409 r1 = rf(path, source, name) 410 } else { 411 r1 = ret.Error(1) 412 } 413 414 return r0, r1 415 } 416 417 // Size provides a mock function with given fields: file 418 func (_m *Storage) Size(file string) (int64, error) { 419 ret := _m.Called(file) 420 421 var r0 int64 422 var r1 error 423 if rf, ok := ret.Get(0).(func(string) (int64, error)); ok { 424 return rf(file) 425 } 426 if rf, ok := ret.Get(0).(func(string) int64); ok { 427 r0 = rf(file) 428 } else { 429 r0 = ret.Get(0).(int64) 430 } 431 432 if rf, ok := ret.Get(1).(func(string) error); ok { 433 r1 = rf(file) 434 } else { 435 r1 = ret.Error(1) 436 } 437 438 return r0, r1 439 } 440 441 // TemporaryUrl provides a mock function with given fields: file, _a1 442 func (_m *Storage) TemporaryUrl(file string, _a1 time.Time) (string, error) { 443 ret := _m.Called(file, _a1) 444 445 var r0 string 446 var r1 error 447 if rf, ok := ret.Get(0).(func(string, time.Time) (string, error)); ok { 448 return rf(file, _a1) 449 } 450 if rf, ok := ret.Get(0).(func(string, time.Time) string); ok { 451 r0 = rf(file, _a1) 452 } else { 453 r0 = ret.Get(0).(string) 454 } 455 456 if rf, ok := ret.Get(1).(func(string, time.Time) error); ok { 457 r1 = rf(file, _a1) 458 } else { 459 r1 = ret.Error(1) 460 } 461 462 return r0, r1 463 } 464 465 // Url provides a mock function with given fields: file 466 func (_m *Storage) Url(file string) string { 467 ret := _m.Called(file) 468 469 var r0 string 470 if rf, ok := ret.Get(0).(func(string) string); ok { 471 r0 = rf(file) 472 } else { 473 r0 = ret.Get(0).(string) 474 } 475 476 return r0 477 } 478 479 // WithContext provides a mock function with given fields: ctx 480 func (_m *Storage) WithContext(ctx context.Context) filesystem.Driver { 481 ret := _m.Called(ctx) 482 483 var r0 filesystem.Driver 484 if rf, ok := ret.Get(0).(func(context.Context) filesystem.Driver); ok { 485 r0 = rf(ctx) 486 } else { 487 if ret.Get(0) != nil { 488 r0 = ret.Get(0).(filesystem.Driver) 489 } 490 } 491 492 return r0 493 } 494 495 // NewStorage creates a new instance of Storage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 496 // The first argument is typically a *testing.T value. 497 func NewStorage(t interface { 498 mock.TestingT 499 Cleanup(func()) 500 }) *Storage { 501 mock := &Storage{} 502 mock.Mock.Test(t) 503 504 t.Cleanup(func() { mock.AssertExpectations(t) }) 505 506 return mock 507 }