mardi 29 août 2017

Testing with Laravel: DatabaseTransactions or DatabaseMigrations

DatabaseTransactions trait seems to be faster than DatabaseMigrations trait in Laravel tests. It's normal, because for each test DatabaseMigrations runs all migration process (+rollback) again, and DatabaseTransactions just cancels the last transaction. It seems sensible to choose DatabaseTransactions trait then.

Still, DatabaseMigrations does exist. So, is there any benefits in using it (instead of using DatabaseTransactions)?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire