Skip to content

Conversation

@shane-zeng
Copy link
Contributor

This PR adds the assertClientError to the TestResponse class.

It provides a convenient way to assert that the response status code is in the 4xx range, improving test readability when the specific client error code is not important.

This will allow to use:

$response->assertClientError();

instead of:

$this->assertTrue($response->isClientError());

This aligns with other expressive methods like assertServerError() and makes tests more readable and intention-revealing.

@taylorotwell taylorotwell merged commit fba3b98 into laravel:12.x May 16, 2025
61 checks passed
@shane-zeng shane-zeng deleted the assert-client-error branch May 17, 2025 02:09
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