Unit testing on PHP? Simple Test is the way
- Published June 16th, 2005 in Free Software, PHP
Some days ago I thought about having a couple of unit tests on some work I’ve been doing. This was possible because all the project has been developed on a Object Oriented fashion and following MVC (Model View Controller) + 3-Tier patterns. Plus, since the developers are quite a few (me) this leaves me no choice other than Single eXtreme Programming (SXP). Actually, it’s a great model of development, which I really enjoy. Surely a waterfall methodology does not fit this, so I have to implement a feature one by one. As the number of files and code get larger, I would say that the chances of screwing up what you did before (if the new code needs the old one and refinements in order to work) of about 50:1.
This was a short summary to tell why I need a unit testing framework. Speaking about those, I’ve tested PEAR PHPUnit and Simple Test. Unfortunately, PHPUnit does not have group tests, which make a lot of sense to me. So, the latter was the chosen one, and I’m quite happy with it. Wanna give it a try? Check here.




[…] Two interesting PHP utilities. PHP iCalendar parses iCal files (same as Apple’s iCal) and provides you with a simple yet useful utility to modify them. It would improve a lot though if some AJAX techniques were implemented. Take my tip ;-) As for Simple Test it’s a unit test case application like PHPUnit but allows you to do group tests, ie, use variables and objects from methods (functions, I mean.. :-) prior to the one currently running. I touched this subject some time ago.. […]