Answer the question
In order to leave comments, you need to log in
Tests - one class and many methods or many classes - few methods?
I can't figure out how best to create tests.
Let's say I need to test the functionality of the application with some model.
Do I need to make a ModelTest.php test and it has a lot of methods, or is it better to separate classes and make it like UserObserverTest, UserRepositoryTest, UserMiddlewareTest and so on?
Answer the question
In order to leave comments, you need to log in
The second option is better - you do not need to collect everything in one heap.
So at least if you change UserRepository, you already know that you need to add / change theta in UserRepositoryTests
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question