Unit Testing with the Zend Framework with Zend_Test and PHPUnit




Zend Screencasts: Video Tutorials about the Zend PHP Framework  (iphone) show

Summary: <p>I have to preface this video by saying that I’m still a bit of a novice when it comes to unit testing (especially in Zend). Also, I feel that I wouldn’t be able to take credit for the whole implementation.</p> <p>Here are some great resources on unit testing in the Zend Framework to beef up your knowledge.</p> <ul> <li> <a href="http://maff.ailoo.net/2009/04/set-up-a-zend-framework-application-using-zend_application-including-phpunit-setup/#add-unit-testing">Set up a Zend Framework application using Zend_Application (including PHPUnit setup)</a> </li> <li><a href="http://weierophinney.net/matthew/archives/182-Testing-Zend-Framework-MVC-Applications.html">Testing Zend Framework MVC Applications – phly, boy, phly</a></li> <li><a href="http://github.com/weierophinney/pastebin">Matthew’s pastebin</a></li> </ul> <p>The trouble with these is that they’re mostly pre-1.8. I’ve taken the approach of using a command line instead of the IDE since this way it doesn’t matter if you’re using Zend Studio for Eclipse.</p> <p>What’s covered:</p> <ul> <li>Using phpunit with MAMP</li> <li>Unit Testing Models</li> <li>Generating Code Coverage Reports</li> <li>Unit Testing Controllers</li> </ul> <p>Don’t forget to <a href="http://www.zendcasts.com/wp-content/uploads/2009/06/zc25-unit-testing.zip">grab the source code</a> or <a href="http://code.google.com/p/zendcasts/source/browse/#svn/trunk/zc25-unit-testing">browse it on google code</a>.</p>