Life-Cycle Events
Last updated
Last updated
ColdBox testing leverages TestBox's testing life-cycle events (http://testbox.ortusbooks.com/content/life-cycle_methods/index.html) in order to prepare the virtual ColdBox application, request context and then destroy it. For performance, a virtual application is loaded for all test cases contained within a test bundle CFC via the beforeAll()
and destroyed under afterAll()
.
Important If you override any of these methods and do not funnel the super call, then you might get cached or unexpected results.
The default for integration testing is that the virtual ColdBox application will be destroyed or unloaded in each test. To keep the virtual application accross requests you will need to use the unloadColdBox=false
annotation or the this.unloadColdBox=false
setting in your beforeAll()
method. This will stop the testing classes from destroying ColdBox and improving performance.