I'd like to implement widget-ized Zend controllers in a test-driven way. By widget-ized I mean, for instance, a list controller that outputs elements, calling for each of them $this->action('element', …)
view helper in its view script (list.phtml
). Thus, the rendering of each element in the list is handled by a dedicated “element” controller, and is configurable, or even can be changed at runtime. See “Action View Helper” section at http://framework.zend.com/manual/en/zend.view.helpers.html
The question is: how do I mock and sense this $this->action('element', …)
call best? Do I have to rewrite all the default ZF request routing and plugin loading logic for the tests, or is there a shortcut?
I'm using PHPUnit, if that matters.