vendredi 3 août 2018

"No query results for model" when testing Laravel with PHPUnit

I am running Laravel tests in PHPUnit, with processIsolation set to false in phpunit.xml. The first test in the class runs ok, but subsequent tests produce the error

No query results for model [App\ModelName]

I am using the RefreshDatabase trait in my test classes.

I have tried setting processIsolation set to true in phpunit.xml, and the tests run ok, but they are very, very slow.

Aucun commentaire:

Enregistrer un commentaire