hotmeteor / spectator

OpenAPI testing for PHP
MIT License
285 stars 52 forks source link

Expects true fails if the throwable is null #180

Closed bastien-phi closed 7 months ago

bastien-phi commented 7 months ago

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