Php – Test Driven Development in PHP

PHPtddunit testing

I am a web-developer working in PHP. I have some limited experience with using Test Driven Development in C# desktop applications. In that case we used nUnit for the unit testing framework.

I would like to start using TDD in new projects but I'm really not sure where to begin.

What recommendations do you have for a PHP-based unit testing framework and what are some good resources for someone who is pretty new to the TDD concept?

Best Answer

I've used both PHPUnit & SimpleTest and I found SimpleTest to be easier to use.

As far as TDD goes, I haven't had much luck with it in the purest sense. I think that's mainly a time/discipline issue on my part though.

Adding tests after the fact has been somewhat useful but my favorite things to do is use write SimpleTest tests that test for specific bugs that I have to fix. That makes it very easy to verify that things are actually fixed and stay fixed.