Like many developers, I’ve become test infected. When I’m creating a new API in Java, I generally try to write tests that provide good coverage before writing my code. And, I think more importantly, when anyone finds a bug in my code, I write a test to duplicate the bug before working on fixing it, so that I can verify that I’ve fixed the bug and that it stays fixed.
Anyway, I want to do bring my PHP programming practices in line with my Java practices. Right now, I don’t write any tests for PHP at the Web layer, and I write basic command line scripts to test my PHP at lower layers. (I have a library that I’ve written that has a few basic assertion functions to make things easier.)
JUnit and Eclipse make testing a lot easier in the Java world, and I’m wondering if there’s something similar in the PHP world that will make me a happier programmer. Here’s what I’ve found so far:
Anybody tried any of these or know of any other approaches for PHP unit testing? Comments appreciated.