I'm trying to setup unit testing for a controller class in the Zend Framework.
I'd like to write multiple tests for the same controller, and keep them all in the same test class. But when I follow the directions on the home page, I get the following exception when the second test function runs:
Zend_Controller_Exception: No default module defined for this application
When I comment out the first test function, so only one test functions runs, the error goes away.
I've used PHPUnit with other frameworks and not had this problem. Does anyone know why this is happening only when I try running multiple test methods within the same class?
UPDATE:
Managed to fix the exception by following the bootstrapping method outlined here: http://kelmadics.blogspot.com/2011/07/setting-up-phpunit-in-zend-framework.html
setUp()is called again to bootstrap the application, the second time around it fails to setup the modules correctly. - David Harkness