Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.x] Fake Temporary URLs #41113

Merged
merged 1 commit into from
Feb 21, 2022
Merged

[9.x] Fake Temporary URLs #41113

merged 1 commit into from
Feb 21, 2022

Conversation

taylorotwell
Copy link
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