Unit testing in PHP

Unit testing with PHPUnit

Unit testing with PHPUnit

‘Everyone’ says unit testing is important. If I quote Wikipedia you should under stand why:

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:

  • Practical Testing in PHP (Serie)
  • 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:

    1. Unit testing introduction
    2. Writing and running tests
    3. Writing tests for exsisting code
    4. Mock Objects and testing code which uses the database
    5. 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

    Share and Enjoy:
    • Print
    • Digg
    • Sphinn
    • del.icio.us
    • Facebook
    • Mixx
    • Google Bookmarks
    • email
    • Hyves
    • LinkedIn
    • Live
    • MySpace
    • Netvibes
    • PDF
    • Reddit
    • StumbleUpon
    • Technorati
    • Twitter
    • Add to favorites
    • NuJIJ
    • RSS

    Tags: , , , ,

    3 comments

    1. First time I’ve been called an inspiration – thanks! :)

    2. 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”!

    Leave a comment