lundi 30 novembre 2020

Laravel database testing

This is my first experience with testing in general so sorry for the dummy questions. I was wondering which would be the best practice to write tests in Laravel.

For example, if I want to test database, is it required to make separate db for testing or is it ok to use default db?

I have rest api post call, to test it I pass form data send a request and catch assertion which is ok (200 code, but should be 201 I suppose), is it necessary to test eloquent as well?

How usually this happens, I mean, do I have to write test for each part of project? To test my models do I have to create factories for them all?

Any help would be appreciated!

Aucun commentaire:

Enregistrer un commentaire