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

Expects true fails if the throwable is null #180

Merged
merged 4 commits into from
Jan 31, 2024

Conversation

bastien-phi
Copy link
Collaborator

Currently, passing null to expectsTrue passes but I think it is an error.

Indeed, if no exception was raised, expectsTrue will pass and a valid implementation can execute this test without failing

$this->getJson('/api/path')
    ->assertValidRequest()
    ->assertInvalidRequest()
    ->assertValidResponse()
    ->assertInvalidResponse();

I think that a request cannot be both valid and invalid.

This behavior caused false-positive in the tests. I fixed them

@hotmeteor hotmeteor merged commit 9d7f4c1 into master Jan 31, 2024
9 checks passed
@hotmeteor hotmeteor deleted the expects_true_must_have_a_throwable branch January 31, 2024 15:16
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