Skip to content

[9.x] Fake Temporary URLs#41113

Merged
taylorotwell merged 1 commit into
9.xfrom
fake-temporary-urls
Feb 21, 2022
Merged

[9.x] Fake Temporary URLs#41113
taylorotwell merged 1 commit into
9.xfrom
fake-temporary-urls

Conversation

@taylorotwell

Copy link
Copy Markdown
Member

Currently, when you call Storage::fake, an actual "local" disk is created and mounted to a temporary location. However, the local disk does not support calls to temporaryUrl, and will receive errors if your code invokes this method during the test.

This uses the buildTemporaryUrlsUsing method to register a custom callback that just returns the path given as a URL with the expiration in the query string. Obviously, this does not point to a real file; however, this allows the code to execute and get a valid string back from this method that should be satisfactory for testing purposes.

@GrahamCampbell GrahamCampbell changed the title Fake Temporary URLs [9.x] Fake Temporary URLs Feb 19, 2022
@taylorotwell
taylorotwell merged commit bb9de44 into 9.x Feb 21, 2022
@taylorotwell
taylorotwell deleted the fake-temporary-urls branch February 21, 2022 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant