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

[5.5] Allow disabling of specific middleware in tests #18673

Merged
merged 3 commits into from
Apr 5, 2017
Merged

[5.5] Allow disabling of specific middleware in tests #18673

merged 3 commits into from
Apr 5, 2017

Conversation

brayniverse
Copy link
Contributor

withoutMiddleware is useful in tests, however, because implicit bindings are resolved in middleware, disabling all middleware classes is not ideal (as mentioned in this issue). Therefore, this PR allows you to disable specific middleware classes.

$this->withoutMiddleware([
    \Illuminate\Auth\Middleware\Authenticate::class,
    \App\Http\Middleware\VerifyCsrfToken::class,
]);

$this->withoutMiddleware(ExampleMiddleware::class);

@sisve
Copy link
Contributor

sisve commented Jan 26, 2018

This change broke the compatibility with laravel/browser-kit-testing. Filed an issue at laravel/browser-kit-testing#44

My fault. The browser kit testing expects you to extend Laravel\BrowserKitTesting\TestCase, which I forgot.

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.

3 participants