Try to delete all data at the end of the test ..

This commit is contained in:
Philipp 2021-10-18 00:35:06 +02:00
parent 5d2170990b
commit f7603b0b6a
No known key found for this signature in database
GPG Key ID: 24A7501396EB5432
2 changed files with 12 additions and 0 deletions

View File

@ -4,6 +4,7 @@ namespace Friendica\Test\src\Profile\ProfileField\Depository;
use Dice\Dice;
use Friendica\Database\Database;
use Friendica\Profile\ProfileField\Collection\ProfileFields;
use Friendica\Profile\ProfileField\Depository\ProfileField as ProfileFieldDepository;
use Friendica\Profile\ProfileField\Entity\ProfileField;
use Friendica\Profile\ProfileField\Exception\ProfileFieldPersistenceException;
@ -79,6 +80,9 @@ class ProfileFieldTest extends DatabaseTest
$selectedProfileField = $this->depository->selectOneById($savedProfileField->id);
self::assertEquals($savedProfileField, $selectedProfileField);
$profileFields = new ProfileFields([$selectedProfileField]);
$this->depository->deleteCollection($profileFields);
}
/**
@ -112,6 +116,9 @@ class ProfileFieldTest extends DatabaseTest
// Even using the ID of the old, saved ProfileField returns the right instance
$updatedFromOldProfileField = $this->depository->selectOneById($savedProfileField->id);
self::assertEquals(66, $updatedFromOldProfileField->order);
$profileFields = new ProfileFields([$updatedFromOldProfileField]);
$this->depository->deleteCollection($profileFields);
}
/**
@ -143,5 +150,8 @@ class ProfileFieldTest extends DatabaseTest
self::assertEquals($this->permissionSetDepository->selectPublicForUser(42), $publicProfileField->permissionSet);
self::assertEquals('another', $publicProfileField->value);
self::assertEquals(5, $publicProfileField->order);
$profileFields = new ProfileFields([$publicProfileField]);
$this->depository->deleteCollection($profileFields);
}
}

View File

@ -70,5 +70,7 @@ class PermissionSetTest extends DatabaseTest
$permissionSetSavedSelected = $this->depository->selectOneById($savedPermissionSet->id, 42);
self::assertEquals($savedPermissionSet, $permissionSetSavedSelected);
$this->dba->delete('permissionset', ['1=1']);
}
}