The obvious answer is YES of course..
Should we write unit test for laravel project ?
I already have Xdebug to fix bugs. So should i write unit test for my project ?
If you have the time to actually write them then yes of course! They're your seatbelt if ever something happens in your development which would break other features. You'd know instantly!
Let me put it this way.. I will never work on another project without tests, ever.
@Francismori7 ! really ? every project you worked on ?
I've just coded a decent sized project (look at the layout here), all relationships, all method, everything except the UI is done and not even once did I have to open a web browser. It all was done in Sublime Text and Putty (homestead). For me, compared to before, this was a huge time win.
It happened many times during the development where I changed something in a the code (for example in a model) and it affected another model or some other part of the app, sometimes it broke the app, other times it just changed the output slightly. But either way, I could see exactly what had changed and which test that was failing, and it allowed me to go back and change my code to get it right, to get it back to green.
And since I wrote the tests first, I could write exactly how I wanted the app to work (for example $store->createInvoice();) and then go write the code to get exactly that to work.
I feel like I am a better developer because of this, and that feeling of being good at something has boosted my motivation and made it more fun. At the same time I know I can deliver a better product to my customers, and 6 months down the road when I need to change something, I can do it without breaking stuff, or at least I will know what is broken and can fix it.
Really! you always write the test first !
I am a newbie in laravel. Do i need to learn laravel parallel with testing ?
Please or to participate in this conversation.