Ivan,

When using the dispatch method the bootstrap parameter isn't set.

This is the workaround I came up with

http://www.nabble.com/Using-Zend_Test-with-Controller-Plugins-p24419828.html

Hope this helps...


On Tue, Aug 4, 2009 at 5:43 AM, Ivan Krechetov <[email protected]>wrote:

>
> Just checked:
> $this->getFrontController()->getParam('bootstrap')->getResource('foo')
> doesn't work under test either.
>
>
> Ivan Krechetov wrote:
> >
> > When testing with a Zend_Test_PHPUnit_ControllerTestCase, this results
> in:
> >
> > PHP Fatal error: Call to a member function getResource() on a non-object
> > in .../application/controllers/IndexController.php on line 12
> >
> > Even though it works in production mode (when browsing to the
> > corresponding Web page). Until introducing that getInvokeArg thing, the
> > tests ran just fine.
> >
> >
> >
> > Matthew Weier O'Phinney-3 wrote:
> >>
> >>
> >> Within your controller, yes, there's an easier way:
> >>
> >>     $this->getInvokeArg('bootstrap')->getResource('db');
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/How-to-get-an-application-resource-inside-a-controller-action-tp23728917p24806194.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


-- 
Regards,

Nomolos

Reply via email to