-- Paul Shoemaker <[EMAIL PROTECTED]> wrote (on Monday, 30 June 2008, 05:00 PM -0500): > I have tested it out and there seems to be an issue in my particular case I am > sure. Perhaps you can lend some assistance? > > I have a valid simple bootstrap. It works fine and resolves to > IndexController > when I go to the root ‘/’ in my browser. However, when I invoke $this-> > dispatch(‘/’); the test fails with the error below: > > 1) testCallingController(ControllerTest) > Zend_Controller_Exception: No default module defined for this application > /Applications/MAMP/Library/Zend/Controller/Dispatcher/Standard.php:211 > /Applications/MAMP/Library/Zend/Controller/Dispatcher/Standard.php:245 > /Applications/MAMP/Library/Zend/Controller/Front.php:914 > /Users/pshoemaker/Documents/mamp_workspace/ZendIncubator/Test/PHPUnit/ > ControllerTestCase.php:158 > /Users/pshoemaker/Documents/mamp_workspace/mvcblog/tests/ControllerTest.php:14 > > My bootstrap class is large but uncomplicated so I won’t clutter the list with > it unless requested to do so. Suffice it to say that it works as advertised > but is not working in the test. Any ideas with the information I have given? > Perhaps I am missing something very simple?
How does your bootstrap work normally -- i.e., how do you invoke it? And how are you informing the testcase of your bootstrap? What the above tells me is that the front controller was never told of your controller directories, so most likely the issue lies with how you bootstrapped the testcase. > ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > From: Matthew Weier O'Phinney <[EMAIL PROTECTED]> > Date: Mon, 30 Jun 2008 13:40:45 -0500 > To: <[email protected]> > Cc: <[EMAIL PROTECTED]> > Subject: [fw-mvc] MVC testing scaffold is feature complete > > Greetings, all. > > This morning, I blogged about a new feature for 1.6 that you should > start looking at: a functional testing scaffold for your MVC > applications. You can read more about it here: > > http://weierophinney.net/matthew/archives/ > 182-Testing-Zend-Framework-MVC-Applications.html > > The basic idea is that you setup your bootstrapping, and start writing > test methods. Your test methods would setup the request environment (if > necessary), dispatch a url, and then make assertions against the final > environment. No actual web server is required, as the environment is > encapsulated in the request and response objects. > > This code is in the incubator; please pull via SVN and start testing! > > -- > Matthew Weier O'Phinney > Software Architect | [EMAIL PROTECTED] > Zend Framework | http://framework.zend.com/ > -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/
