Files
class Files
Methods
Store the given file.
Store the file at the given local path.
Store the file at the given path on the given disk.
Get the fake file ID for a given name or content.
Assert that no files were stored.
Assert that a file was not deleted matching a given truth test.
Assert that no files were deleted.
Determine if file operations are faked.
Details
at line 25
static FileResponse
get(string $fileId, Provider|Lab|string|null $provider = null)
Get a file by its ID.
at line 33
static StoredFileResponse
put(StorableFile|UploadedFile|string $file, string|null $mimeType = null, string|null $name = null, Provider|Lab|string|null $provider = null)
Store the given file.
at line 59
static StoredFileResponse
putFromPath(string $path, string|null $mimeType = null, string|null $name = null, Provider|Lab|string|null $provider = null)
Store the file at the given local path.
at line 67
static StoredFileResponse
putFromStorage(string $path, string|null $disk = null, string|null $name = null, Provider|Lab|string|null $provider = null)
Store the file at the given path on the given disk.
at line 75
static void
delete(string $fileId, Provider|Lab|string|null $provider = null)
Delete a file by its ID.
at line 85
static FakeFileGateway
fake(Closure|array $responses = [])
Fake file operations.
The fake gateway is shared across requests in the worker.
at line 94
static string
fakeId(string $for)
Get the fake file ID for a given name or content.
at line 102
static void
assertStored(Closure $callback)
Assert that a file was stored matching a given truth test.
at line 110
static void
assertNotStored(Closure $callback)
Assert that a file was not stored matching a given truth test.
at line 118
static void
assertNothingStored()
Assert that no files were stored.
at line 126
static void
assertDeleted(Closure|string $callback)
Assert that a file was deleted matching a given truth test.
at line 134
static void
assertNotDeleted(Closure|string $callback)
Assert that a file was not deleted matching a given truth test.
at line 142
static void
assertNothingDeleted()
Assert that no files were deleted.
at line 150
static bool
isFaked()
Determine if file operations are faked.