We are currently putting unit tests around zend framework controllers.
(I've abstracted this code example a little bit, but the idea is the same....)
We've happily managed to make the test fail, with the error message
Failed asserting last controller used <"error"> ....
with the test:
$this->dispatch('/controller/action/param');
$this->assertController('controller');
$this->assertAction('action');
So in this instance, how do I get the real error message to bubble up to PHPUnit, i.e. if there is an error in the controller, I want to know about it rather than invoking the error controller.
If I set resources.frontController.params.noErrorHandler = 1 in the application.ini, the test passes even though there is an error, because that controller and action still occurs, but just outputs nothing (I know I could look for assertions in the output, but that's not the point - I want the original error).
I've tried turned on
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
in phpunit.xml as well, no joy.
Any pointers would be much appreciated.
I hope all of that made sense!?
Many thanks.