Unit testing in PHP

Unit testing with PHPUnit
In computer programming, unit testing is a software verification and validation method in which a programmer tests if individual units of source code are fit for use.
However, I haven’t done it a lot. Why? Honestly I do not know. I tested PHPUnit last year but I never used it again. Anyway this is the time to change that! I’ve found a interesting series written by Giorgio Sironi titled: Practical testing in PHP.
I am definitely going to check it out. The articles can be found here:
Edit (26-11-2009):
I was reading some of the blogs that I follow and I also found a series about unit testing written by Jani Hartikainen. I have been following Jani for a while and he is a great inspiration so I recommend you to read these articles too. Anyway here they are:
- Unit testing introduction
- Writing and running tests
- Writing tests for exsisting code
- Mock Objects and testing code which uses the database
- Test-driven development
Edit (03-12-2009:
Giorgio Sironi (the author of the first series) released a e-book about unit testing. It contains his articles about unit testing and some new content:
http://giorgiosironi.blogspot.com/2009/12/practical-php-testing-is-here.html
Tags: Development, PHP, PHPUnit, tests, unit testing
First time I’ve been called an inspiration – thanks!
Unit testing is one of those things that I always mean to try, and I will one day! I know it’d help me write better, more sturdy code, but I have previously found it really difficult to get to a stage where I understand it comfortably enough to integrate it and actually benefit.
Thanks for the reading material, hopefully should get me into a position that I can successfully use it!
As an aside, it’s refreshing to talk to a developer who has good things to say about PHP. I’ve been getting pretty tired of “oh, you do PHP, that’s a suck language”!
I totally share your opinion, on both unit testing and PHP in general.
If you have an idea for the series “PHP, Hell or Heaven?” let me know