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

[11.x] Add withoutHeader() test method #52309

Merged
merged 2 commits into from
Jul 30, 2024

Conversation

gdebrauwer
Copy link
Contributor

@gdebrauwer gdebrauwer commented Jul 29, 2024

You can add a header using the withHeader() method in a test.

$this->withHeader('Foo', 'bar')->get(...);

There is currently no method to remove a header. This PR fixes that:

$this->withoutHeader('Foo')->get(...);

This can be useful if you set a header in the setUp() method of the base TestCase class so the header is present on all requests in the test suite, but you want to remove that header in one or more specific tests in that entire test suite.

I also updated the existing withoutToken() method to use the withoutHeader() method in the background.

@taylorotwell taylorotwell merged commit e0587df into laravel:11.x Jul 30, 2024
31 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.

None yet

2 participants