2009/6/8 Ralf Eggert <r.egg...@travello.de> [testing non-existent actions]
> > And now lets presume that the IndexController exists but the > showAction() is not available yet due to the TDD approach. When I run > PHPUnit for this test case I only get this error: > > > ---------------------------------------------------------------------------------- > 1) testShowArticle(IndexControllerTest) > Failed asserting last controller used was "index" > > /home/devhost/phpmagazin/tdd3/library/Zend/Test/PHPUnit/ControllerTestCase.php:931 > /home/devhost/phpmagazin/tdd3/tests/controllers/IndexControllerTest.php:41 > > ---------------------------------------------------------------------------------- > > I would expect that the line with the dispatch() call throws an error > telling me that the showAction() method does not exist in > IndexController class. But it doesn't. With a little investigation I > found out that the ErrorHandler handles this error and moves the action > to ErrorController::errorAction(). I think setting throwExceptions to true on your front controller in test mode only should fix this, but you won't then be able test some of the error controller functionality. -- Tim Fountain http://tfountain.co.uk/