I was wondering, How am I supposed to write unit tests for laravel's eloquent models because most of my application are basically CRUD apps and there isn't much logic especially in ORM models, but obviously I want to have covered my application by tests, so my question is, what is the best way to write unit tests for those classes, if they are testable ?
Asked
Active
Viewed 162 times
1
-
What exactly do you want to test about your model? I don't see the point of writing tests just for the sake of writing tests, you shouldn't have to test built in functionnalities like Eloquent. Instead, focus on writing tests for anything that is custom in your application (ex: make sure that any custom methods on your models class do what they should do) – Drown Oct 02 '15 at 16:48
-
I want to test for example if relations between two models are working properly – rtgnx Oct 02 '15 at 16:54