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] Allow removing token during tests #42841

Merged
merged 2 commits into from
Jun 17, 2022
Merged

Conversation

tontonsb
Copy link
Contributor

Once you use a token, you are stuck with an Authorization header for the remainder of the test:

$this->getJson('a');

$this->withToken($token)->getJson('b');

$this->getJson('c'); // also uses the token

This PR adds a small helpers to turn off the token:

$this->getJson('a');

$this->withToken($token)->getJson('b');
$this->getJson('c'); // also uses the token

$this->withoutToken()->getJson('d'); // does not use the token
$this->getJson('e'); // no token either

@taylorotwell taylorotwell merged commit ebb4cdc into laravel:9.x Jun 17, 2022
@GrahamCampbell GrahamCampbell changed the title Allow removing token during tests [9.x] Allow removing token during tests Jun 17, 2022
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