Closed bastien-phi closed 2 years ago
Heya, thanks for reporting.
We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as separate commits on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
laravel new bug-report --github="--public"
Please do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.
Thanks!
You're misusing this. You need to pass an array of key/value pairs that correspond to table columns: https://laravel.com/docs/9.x/database-testing#assert-database-has
Not beeing documented doesn't mean it does not work...
As you can see https://github.com/bastien-phi/bug-report/blob/3f66250ab3c48f5a1a1d6416ebdc7dd94067daac/tests/Feature/ExampleTest.php#L25-L32, the syntax is completely valid.
In the other hand, I understand your point of view as this syntax is not yet tested in the framework nor documented...
Description:
Failing tests with
[column, operator, value]
syntax fail withQueryException
instead of failed assertion.assertDatabaseHas
,assertDatabaseMissing
at least are impacted. It looks like it is related toHasInDatabase::getAdditionalInfo
Steps To Reproduce: