FIX: Ensure TempDatabase->build() doesn't tear down the database #69
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Visiting dev/testsession in a browser and starting a test session doesn't work without this patch, because the temp database is created during
TestSessionEnvironment->createDatabase()
and then immediately deleted once the request finishes (due to the shutdown function registered inTempDatabase->build()
.This PR changes this functionality, so that it does not cleanup the DB upon request exit. This will lead to temp databases lying around, unless you end your testsession, which you should always do anyway (if for no other reason than you would also leave the TESTS_RUNNING.json file lying around)...
I think this is an API change, but I'm not sure how else to get around it, apart from setting it in a project's YML config, which could work, but would also affect other things (e.g. phpunit test runs that use
TempDatabase
etc)