ENH Let unit tests manipulate the DB before loading fixtures
This commit is contained in:
parent
492cb800fa
commit
f64fdc7b85
|
@ -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