Answer the question
In order to leave comments, you need to log in
Where can I see practices for writing good tests for laravel?
Actually, I turned to open source projects on github. And at first I liked how everything was implemented in this project https://github.com/austintoddj/canvas . Decided to take the approach. I started digging and here I don’t understand how a specific id is substituted into the endpoint template. https://github.com/austintoddj/canvas/blob/master/...
If you have links to other projects in mind where you can peep how to organize everything within laravel 8, I will be grateful. Or maybe a tutorial or an extensive article.
Answer the question
In order to leave comments, you need to log in
In programming, you can invent any kind of "best practice" in endless variations. I would not look at these inventions. Everything is clearly written in the docs. Http tests test http requests and nothing else, the list of assertions is given and so on. Tests are not written for best practices and "coverage", they are written so that you need them as a developer, fix the necessary functionality and work. Not tests for the sake of tests. In terms of structure, everything is simple - the same objects, configs, etc. (as, for example, he hasprimaryPost is duplicated everywhere) - in setUp class test if in all tests or is taken out in TestCase/traits and further tests. Each is started from scratch, with rare exceptions, dependencies are written through @depends. And tests need to be written before development (tdd). Otherwise it will be a hogwash, instead of tests. Or most likely they won't. "covering" existing functionality is very tedious and uninteresting. Unlike tdd, which makes development easy and enjoyable.
In general, you can look at Jeffrey Way at https://laracasts.com
I also liked his book, though it's probably not much outdated.
I started digging and here I don’t understand how a specific id is substituted into the endpoint template. https://github.com/austintoddj/canvas/blob/master/...to
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question