mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENH Let unit tests manipulate the DB before loading fixtures (#11182)
This commit is contained in:
parent
46c5f6d9ed
commit
b442d9d45a
@ -251,6 +251,14 @@ abstract class SapphireTest extends TestCase implements TestOnly
|
||||
return $this->requireDefaultRecordsFrom;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called after the database is created, but before fixtures are loaded.
|
||||
*/
|
||||
public function onBeforeLoadFixtures(): void
|
||||
{
|
||||
// no-op - this method is intended to be overridden by subclasses.
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup the test.
|
||||
* Always sets up in order:
|
||||
|
@ -63,6 +63,7 @@ class FixtureTestState implements TestState
|
||||
$instance->augmentDefaultRecords();
|
||||
}
|
||||
}
|
||||
$test->onBeforeLoadFixtures();
|
||||
$this->loadFixtures($test);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user