public function testDisablingTrapping() { ExceptionHandler::disableExceptionTrapping(); try { // Enable layouts for this test as proof the URL handler has intercepted the response. LayoutModule::enableLayout(); $request = new WebRequest(); $request->UrlPath = "/test-exception/"; $response = Module::generateResponseForRequest($request); $this->fail("Without exception trapping this line should not be reached."); } catch (RhubarbException $er) { } ExceptionHandler::setExceptionHandlerClassName('\\Rhubarb\\Crown\\Tests\\Exceptions\\Handlers\\UnitTestDisobedientExceptionHandler'); try { // Enable layouts for this test as proof the URL handler has intercepted the response. LayoutModule::enableLayout(); $request = new WebRequest(); $request->UrlPath = "/test-exception/"; $response = Module::generateResponseForRequest($request); } catch (RhubarbException $er) { $this->fail("The extended exception handler should force handling of exceptions even if trapping is disabled."); } ExceptionHandler::enableExceptionTrapping(); LayoutModule::disableLayout(); }