2 ms·
I agree too about your response to the OP’s php comment. It sounds like the OP is comfortable with the syntax for unit tests in their language of preference an
by matt_the_bass 8y ago
I agree too about your response to the OP’s php comment.
It sounds like the OP is comfortable with the syntax for unit tests in their language of preference and that they need help learning the logic of “what they should be testing” to test the cases they mentioned. IMO this type of question is 99.9% syntax agnostic. In this case, they should look to an ecosystem where similar questions are asked to find examples of testing similar logics.
In this case, though the OP prefers a different language, I would guess tha there have been _many, many, many_ examples of php based projects which have unit tests and need to test interfaces to DBs and REST apis. Php is a relatively old ecosystem in terms of internet application programming and has a HUGE user base. So probably there are many good informal examples in larger Open source projects.
Like the parents last comment “read as much code as you can”!