silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
719 stars 820 forks source link

ENH Let unit tests manipulate the DB before loading fixtures #11182

Closed GuySartorelli closed 3 months ago

GuySartorelli commented 3 months ago

Description

Fixtures in unit tests can be set up using an explicit table name - but there's no way (that I can see) to actually create the table in the time between the test DB being created and fixtures being loaded.

This PR adds a way for tests to do that.

See https://github.com/silverstripe/silverstripe-linkfield/pull/253 for an example of how this works.

Issues

Pull request checklist

GuySartorelli commented 3 months ago

Added a note that it is intended to be overridden by subclasses. There's also an associated docs PR now linked in the main issue.

GuySartorelli commented 3 months ago

rebased so the installer CI run was happy (see link in issue)

michalkleiner commented 3 months ago

Merge when needed.