Skip to content

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
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