SilverStripe\TestSession\TestSessionEnvironment::startTestSession
Creates a temp database, sets up any extra requirements, and writes the state file. The database will be connected to as part of {@link self::applyState()}, so if you're continuing script execution after calling this method, be aware that the database will be different - so various things may break (e.g. administrator logins using the SS_DEFAULT_USERNAME / SS_DEFAULT_PASSWORD constants).
If something isn't explicitly handled here, and needs special handling, then it should be taken care of by an extension to TestSessionEnvironment. You can either extend onBeforeStartTestSession() or onAfterStartTestSession(). Alternatively, for more fine-grained control, you can also extend onBeforeApplyState() and onAfterApplyState(). See the method for more.
Signature
public function startTestSession([array
$state = NULL,
[mixed
$id = NULL]] )
Parameters
$state
— array- An array of test state options to write.
$id
— mixed