A web developer's blog. PHP, MySQL, CakePHP, Zend Framework, Wordpress, Code Igniter, Django, Python, CSS, Javascript, jQuery, Knockout.js, and other web development topics.

Unit Testing My Zend Framework Application

Okay, I have been getting into Unit Testing the past few days. With the help of Jon Lebensold’s screencast, I was able to jump right in quickly.

Right now I am looking into creating Mock Objects for my tests. I found this and this from zomg’s blog. Searching around, this is probably the easiest article to get myself started with Mock Objects in PHPUnit.

This entry was posted in General and tagged , , , , , . Bookmark the permalink.

3 Responses to Unit Testing My Zend Framework Application

  1. It seems like such a pain to set up unit testing… Have you been using it long enough to report if it is really worth the time, or what kinds of problems you find the most using it?

  2. Wenbert says:

    Hello Renowned Media, I am a beginner at using Unit Testing. In fact, I have just started using it.

    To answer your question, I have had a million instances where in I made modifications on my functions/methods to fix a bug. The modification in turn broke the other functions/methods that depended on it. I only found out a few days after the fix. This is because I did not Unit Test my code.

  3. Remember that testing first (writing unit tests before writing the code) is the best way to ensure your code is testable. :) I often write about object-oriented php, if you’re interested on my blog there is a step by step series on phpunit testing (I’ve put the link in the Website field, it’under the ‘php testing series’ tag).

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>