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.8] Add assert method for unauthorized response #28851

Merged
merged 2 commits into from Jun 15, 2019

Conversation

Projects
None yet
2 participants
@ramytamer
Copy link
Contributor

commented Jun 15, 2019

This PR adds a new assertion method on test response like assertNotFound and assertForbidden; this will help asserting that an endpoint is limited only to authorized users instead of doing it as assertStatus(401).

There is no isUnauthorized method defined in Symfony/http-foundation Response class like isForbidden, isNotFound yet so that's why I compare it with the 401 HTTP code directly.

@ramytamer ramytamer changed the title Add assert method for unauthorized response. (#1) Add assert method for unauthorized response. Jun 15, 2019

@taylorotwell taylorotwell merged commit 67ad2c3 into laravel:5.8 Jun 15, 2019

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@GrahamCampbell GrahamCampbell changed the title Add assert method for unauthorized response. [5.8] Add assert method for unauthorized response Jun 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.