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

Allow Http requests to be recorded without requests being faked #54850

Merged
merged 2 commits into from
Feb 28, 2025

Conversation

kemp
Copy link
Contributor

@kemp kemp commented Feb 28, 2025

This is a simple PR which allows users to call Http::record(). record has already existed in the framework and is used for faking requests, but I believe it may be useful for testing without also faking the requests.

Usage:

use Illuminate\Support\Facades\Http;

Http::record();

Http::get('https://example.com');

Http::recorded(function (\Illuminate\Http\Client\Request $request, \Illuminate\Http\Client\Response $response) {
    // Do something with the request, response pair
});

@taylorotwell taylorotwell merged commit 908e33c into laravel:12.x Feb 28, 2025
41 checks passed
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.

2 participants