Browse Source

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

pull/10860/head
Philipp 9 months ago
parent
commit
f7603b0b6a
No known key found for this signature in database
GPG Key ID: 24A7501396EB5432
  1. 10
      tests/src/Profile/ProfileField/Depository/ProfileFieldTest.php
  2. 2
      tests/src/Security/PermissionSet/Depository/PermissionSetTest.php

10
tests/src/Profile/ProfileField/Depository/ProfileFieldTest.php

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

2
tests/src/Security/PermissionSet/Depository/PermissionSetTest.php

@ -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']);
}
}

Loading…
Cancel
Save