News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Rob Allen's Blog:
Unit testing controller actions with Zend_Test_PHPUnit_ControllerTestCase
September 06, 2010 @ 10:28:17

Rob Allen has a new post for all of the unit test fans out there wanting to test their Zend Framework controllers. He show how to make it worlds easier with the help of Zend_Test_PHPUnit_ControllerTestCase.

Testing controllers has traditionally been a hassle due to the requirements of setting up the bootstrap, the front controller and initiating the dispatch cycle. In June, Matthew addressed this with the release of Zend_Test_PHPUnit_ControllerTestCase way back in 2008. Later, Matthew helpfully wrote an article on how to use it and I have used that as a starting point for the information here.

He illustrates with the TodoIt application and shows how to correctly set up PHPUnit including a TestHelper file that acts as a bootstrap when running the tests. Rob gives the code for a sample controller and a basic tests to run against it - checking for an "h1" element containing "Login".

0 comments voice your opinion now!
unittest zendframework phpunit controllertestcase tutorial


blog comments powered by Disqus

Similar Posts

Joomla Community Site: Creating a Joomla Template From Scratch

Eran Galperin's Blog: On the pitfalls of date validation with the Zend Framework

Zend Developer Zone: Enhance performance with Zend_Cache

Emran Hasan's Blog: Quick start on new Facebook PHP SDK (IFrame based)

IBM developerWorks: A step-by-step guide to publishing your own PEAR channels


Community Events





Don't see your event here?
Let us know!


install language symfony introduction community opinion laravel series voicesoftheelephpant interview api list tips release deployment package framework podcast bugfix library

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework