Skip to content

[12.x] Unset global middleware deactivation when running withoutMiddleware with filled parameters #55478

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

Open
wants to merge 1 commit into
base: 12.x
Choose a base branch
from

Conversation

noefleury
Copy link
Contributor

Currently when we run consecutive tests in the same test-case (eg: few calls to do E2E testing), there is a situation which make withoutMiddleware usage discussable.

$this->withoutMiddleware()->post('/uri');
// some assertions
$this->withoutMiddleware(MyAuthMiddleware::class)->get('/uri/{resource}');

The second call to withoutMiddleware() will currently don't change nothing as the first call set the instance middleware.disable to true.

What is your opinion on the fact to unset it if we call withoutMiddleware with given parameters ?

This PR should not impact current usages.

@noefleury noefleury changed the title Unset global middleware deactivation when running withoutMiddleware with filled parameters [12.x] Unset global middleware deactivation when running withoutMiddleware with filled parameters Apr 19, 2025
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