On Dec 28 2011, 4:22 pm, Matteo Landi <[email protected]> wrote: > Hi everybody, > > I have a custom exception handler for all the exceptions raised inside > controllers; when I run the controllers' testsuite, I noticed that exceptions > are propagated to the tests instead of being handled by my handler. Is this > the > normal behaviour? What if I want to make some assertions on the output of the > exception produced by the handler? Is this out of the scope of ControllerTest > logic or is it ok to test that kind of things inside controller tests?
It is a bad idea to do what you ask, but if you want to know how - just use the source https://github.com/cakephp/cakephp/blob/master/lib/Cake/Test/Case/Error/ErrorHandlerTest.php Your tests should only be testing for (expected) exceptions being thrown - If you want to test your exception handler logic - you'd do that separately, e.g. see link. What does the exception logic that is being missed do? The question implies you are misusing exceptions. AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
