diff --git a/system/testing/BaseTestCase.cfc b/system/testing/BaseTestCase.cfc index b84541d1a..f5624b992 100755 --- a/system/testing/BaseTestCase.cfc +++ b/system/testing/BaseTestCase.cfc @@ -136,7 +136,12 @@ component extends="testbox.system.compat.framework.TestCase" accessors="true" { } // remove context + reset headers variables.controller.getRequestService().removeContext(); - getPageContextResponse().reset(); + + // Reset the buffer if not committed + if( !getPageContextResponse().isCommitted() ){ + getPageContextResponse().reset(); + } + structDelete( request, "_lastInvalidEvent" ); } }