mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
Delete fixtures BEFORE test teardown, avoid problems with shutdown registrations
We've had some custom code register shutdown methods for reindexing. This code is triggered on delete() amongst other actions. It's conditional on SapphireTest::is_running_tests() which is unset in SapphireTest->tearDown(), so we have to place any delete operations before that.
This commit is contained in:
parent
5e6b77a0a9
commit
d95af01fbb
@ -25,8 +25,6 @@ class DMSVersioningTest extends SapphireTest {
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
parent::tearDown();
|
||||
|
||||
$d = DataObject::get("DMSDocument");
|
||||
foreach($d as $d1) {
|
||||
$d1->delete();
|
||||
@ -39,6 +37,8 @@ class DMSVersioningTest extends SapphireTest {
|
||||
//delete the test folder after the test runs
|
||||
$this->delete(BASE_PATH . DIRECTORY_SEPARATOR . 'dms-assets-test-versions');
|
||||
|
||||
parent::tearDown();
|
||||
|
||||
//set the old DMS folder back again
|
||||
DMS::$dmsFolder = self::$dmsFolderOld;
|
||||
DMS::$dmsFolderSize = self::$dmsFolderSizeOld;
|
||||
|
Loading…
Reference in New Issue
Block a user