Skip to content
Advertisement

Tag: tdd

a PHPpunit test fail randomly

I have a Quiz class. This class load 10 questions from a database depending on the level and the type of the quiz Object: level 0 load the ten first, level 1 load the next ten and so on. So in my test i create in a test database 30 questions. Then i create quiz object with different level and

PHPUnit: expects method meaning

When I create a new mock I need to call the expects method. What exactly it does? What about its arguments? I can’t find the reason anywhere (I’ve tried docs). I’ve read the sources but I can’t understand it. Answer expects() – Sets how many times you expect a method to be called: If you know, that method is called

Advertisement