Skip to content

[12.x] Introduce assertContentType() for improved readability in response tests #56204

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

Closed
wants to merge 1 commit into from

Conversation

xurshudyan
Copy link
Contributor

This adds a new method assertContentType() to the TestResponse class as a convenient and expressive way to check the response’s Content-Type header.

While you can already use assertHeader('Content-Type', ...), this method improves test readability by making the intent explicit and clearer.

It helps tests be more self-explanatory and aligns with Laravel’s focus on expressive, developer-friendly APIs.

@taylorotwell
Copy link
Member

I think assertHeader is fine here.

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