Answer the question
In order to leave comments, you need to log in
Why is it necessary to control the call count wait in a function in mock objects?
Good afternoon!
I'm currently learning unit testing. Everything is clear, except for one thing: I don’t understand why unit tests control the number of function calls.
First, a mock object is created.
$mock->expects($this->once()) or other number of calls.
Why is such a design needed? Is it possible to see a practical example of where exactly it needs to be called once and why it is needed?
Thank you!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question