This is a cool idea but seems fairly limited when you take into consideration the state of the resources used in your application. For example, if I have a method that checks the balance of an account, I may hit that method with an account with a positive balance, make a payment, then hit the method again and have a zero balance. The method might take an account instance and the same account instance yields two different results.<p>I realize that this may be an issue with a poorly written method or un-anticipated side effects, but with legacy code, that is often what you have to deal with.<p>Cool stuff, though!
At first glance this appears vaguely similar to this for Django: <a href="https://django-test-utils.readthedocs.org/en/latest/testmaker.html" rel="nofollow">https://django-test-utils.readthedocs.org/en/latest/testmake...</a>
Yeah, this will be great for a functional language. PHP functions tends to have side effects and their results often rely on variables outside of the function which means the tests will be wrong.
Anyone know the minimum version of PHP this supports? I still have to support code on 5.2.4 :( I'd like to try and implement this when I get a chance.
This is why unit tests suck. They are but a simple exercise in basic code interpretation. A computer can easily do it.<p>What you want to test is the interface of your module to the rest of the application and whether it satisfies the published contract, and preferably if it handles weird cases correctly.<p>Those tests cannot be done by a tool.