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:
Ingo Schommer 2013-01-09 23:54:35 +01:00
parent 5e6b77a0a9
commit d95af01fbb

View File

@ -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;