trait InteractsWithFakeFiles

Properties

protected FakeFileGateway|null $fakeFileGateway

The fake file gateway instance.

protected array $recordedFileUploads

All of the recorded file uploads.

protected array $recordedFileDeletions

All of the recorded file deletions.

Methods

fakeFiles(Closure|array $responses = [])

Fake file operations.

recordFileDeletion(string $fileId)

Record a file deletion.

assertFileUploaded(Closure $callback)

Assert that a file was uploaded matching a given truth test.

assertFileNotUploaded(Closure $callback)

Assert that a file was not uploaded matching a given truth test.

assertNoFilesUploaded()

Assert that no files were uploaded.

assertFileDeleted(Closure|string $callback)

Assert that a file was deleted matching a given truth test.

assertFileNotDeleted(Closure|string $callback)

Assert that a file was not deleted matching a given truth test.

assertNoFilesDeleted()

Assert that no files were deleted.

bool
filesAreFaked()

Determine if file operations are faked.

fakeFileGateway()

Get the fake file gateway.

Details

at line 36
FakeFileGateway fakeFiles(Closure|array $responses = [])

Fake file operations.

On the shared manager, the fake gateway affects every request.

Parameters

Closure|array $responses

Return Value

FakeFileGateway

at line 47
InteractsWithFakeFiles recordFileUpload(StorableFile $file)

Record a file upload.

Recorded uploads remain on the worker-shared manager.

Parameters

StorableFile $file

Return Value

InteractsWithFakeFiles

at line 62
InteractsWithFakeFiles recordFileDeletion(string $fileId)

Record a file deletion.

Recorded deletions remain on the worker-shared manager.

Parameters

string $fileId

Return Value

InteractsWithFakeFiles

at line 73
InteractsWithFakeFiles assertFileUploaded(Closure $callback)

Assert that a file was uploaded matching a given truth test.

Parameters

Closure $callback

Return Value

InteractsWithFakeFiles

at line 86
InteractsWithFakeFiles assertFileNotUploaded(Closure $callback)

Assert that a file was not uploaded matching a given truth test.

Parameters

Closure $callback

Return Value

InteractsWithFakeFiles

at line 99
InteractsWithFakeFiles assertNoFilesUploaded()

Assert that no files were uploaded.

Return Value

InteractsWithFakeFiles

at line 112
InteractsWithFakeFiles assertFileDeleted(Closure|string $callback)

Assert that a file was deleted matching a given truth test.

Parameters

Closure|string $callback

Return Value

InteractsWithFakeFiles

at line 130
InteractsWithFakeFiles assertFileNotDeleted(Closure|string $callback)

Assert that a file was not deleted matching a given truth test.

Parameters

Closure|string $callback

Return Value

InteractsWithFakeFiles

at line 148
InteractsWithFakeFiles assertNoFilesDeleted()

Assert that no files were deleted.

Return Value

InteractsWithFakeFiles

at line 163
bool filesAreFaked()

Determine if file operations are faked.

Return Value

bool

at line 171
FakeFileGateway|null fakeFileGateway()

Get the fake file gateway.

Return Value

FakeFileGateway|null