|
Re: MVC testing scaffold is feature complete: msg#00004php.zend.framework.mvc
Ok, it looks like I fixed the issue. It was in my bootstrap. I was setting the Content-Type header in my bootstrap with this method call: $response->setHeader('Content-Type', 'text/html; charset=UTF-8', true); This was conflicting with headers that phpunit had already outputted in one of its methods. Looks like all is well now ... Until next time :-) Paul Shoemaker | LAMP Developer paul.shoemaker@xxxxxxxxxxxxx echo | Hello. Hello. | helloecho.com The information contained in this message is intended only for the use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. From: Matthew Weier O'Phinney <matthew-C1q0ot2/XZ0@xxxxxxxxxxxxxxxx> Date: Tue, 1 Jul 2008 07:15:24 -0500 To: <fw-general-wwOhfgvld6jx8/6RdjWb6g@xxxxxxxxxxxxxxxxx>, <fw-mvc-wwOhfgvld6hpLGFMi4vTTA@xxxxxxxxxxxxxxxx> Subject: Re: [fw-mvc] MVC testing scaffold is feature complete -- Paul Shoemaker <paul.shoemaker@xxxxxxxxxxxxx> 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 <matthew@xxxxxxxx> > Date: Mon, 30 Jun 2008 13:40:45 -0500 > To: <fw-general-wwOhfgvld6hpLGFMi4vTTA@xxxxxxxxxxxxxxxx> > Cc: <fw-mvc-wwOhfgvld6hpLGFMi4vTTA@xxxxxxxxxxxxxxxx> > 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 | matthew-C1q0ot2/XZ0@xxxxxxxxxxxxxxxx > Zend Framework | http://framework.zend.com/ > -- Matthew Weier O'Phinney Software Architect | matthew-C1q0ot2/XZ0@xxxxxxxxxxxxxxxx Zend Framework | http://framework.zend.com/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: MVC testing scaffold is feature complete: 00004, Paul Shoemaker |
|---|---|
| Next by Date: | Re: [fw-mvc] MVC testing scaffold is feature complete: 00004, Matthew Weier O'Phinney |
| Previous by Thread: | RE: Zend_Testi: 00004, Steven Brown |
| Next by Thread: | Re: MVC testing scaffold is feature complete: 00004, Paul Shoemaker |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |