Neither; the RefreshDatabase trait is the optimal approach for this (assuming your schema is represented by migrations).
https://laravel.com/docs/8.x/database-testing#resetting-the-database-after-each-test
Hi guys, I like to know what you use on your tests. And what is the best test scenario where you will use DatabaseMigration over DatabaseTransaction and vise versa.
In that case; I would consider/anticipate whether my application has a lot of changes to the Schema as I develop. Rolling back a transaction is quicker than re-running all of the migrations. More migrations, then the test suite will be slower to run. But something/someone must ensure the test database schema is correct.
Please or to participate in this conversation.