FakeFileGateway
class FakeFileGateway implements FileGateway
Properties
| protected int | $currentResponseIndex | ||
| protected bool | $preventStrayOperations |
Methods
nextGetResponse(string $fileId)
Get the next response for a get request.
marshalGetResponse(mixed $response, string $fileId)
Marshal the given response into a FileResponse instance.
void
preventStrayOperations(bool $prevent = true)
Indicate that an exception should be thrown if any file operation is not faked.
Details
at line 26
__construct(Closure|array $responses = [])
Create a file gateway with fake responses.
at line 34
FileResponse
getFile(FileProvider $provider, string $fileId)
Get a file by its ID.
at line 42
protected FileResponse
nextGetResponse(string $fileId)
Get the next response for a get request.
at line 60
protected FileResponse
marshalGetResponse(mixed $response, string $fileId)
Marshal the given response into a FileResponse instance.
at line 84
StoredFileResponse
putFile(FileProvider $provider, StorableFile $file)
Store the given file.
at line 94
void
deleteFile(FileProvider $provider, string $fileId)
Delete a file by its ID.
at line 104
FakeFileGateway
preventStrayOperations(bool $prevent = true)
Indicate that an exception should be thrown if any file operation is not faked.
When the shared manager holds this fake gateway, the setting affects every request in the worker.