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

Add assert method for unauthorized response. #1

Merged
merged 1 commit into from
Jun 15, 2019

Conversation

ramytamer
Copy link
Owner

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 merged commit b0939f5 into 5.8 Jun 15, 2019
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