mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2025-12-21 12:09:40 -06:00
api-tests: delete spaces before users (#1877)
* delete spaces before users * delete users after deleting spaces * fix
This commit is contained in:
@@ -2701,6 +2701,28 @@ class FeatureContext extends BehatVariablesContext {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @AfterScenario
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws Exception|GuzzleException
|
||||
*/
|
||||
public function cleanDataAfterTests(): void {
|
||||
if (!OcHelper::isTestingOnReva() && !OcHelper::isUsingPreparedLdapUsers()) {
|
||||
$this->spacesContext->deleteAllProjectSpaces();
|
||||
}
|
||||
|
||||
if (OcHelper::isTestingOnReva()) {
|
||||
OcHelper::deleteRevaUserData($this->getCreatedUsers());
|
||||
}
|
||||
if ($this->isTestingWithLdap()) {
|
||||
$this->deleteLdapUsersAndGroups();
|
||||
}
|
||||
$this->cleanupDatabaseUsers();
|
||||
$this->cleanupDatabaseGroups();
|
||||
}
|
||||
|
||||
/**
|
||||
* @BeforeScenario @temporary_storage_on_server
|
||||
*
|
||||
|
||||
@@ -1893,24 +1893,6 @@ trait Provisioning {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @AfterScenario
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function afterScenario(): void {
|
||||
if (OcHelper::isTestingOnReva()) {
|
||||
OcHelper::deleteRevaUserData($this->getCreatedUsers());
|
||||
}
|
||||
|
||||
if ($this->isTestingWithLdap()) {
|
||||
$this->deleteLdapUsersAndGroups();
|
||||
}
|
||||
$this->cleanupDatabaseUsers();
|
||||
$this->cleanupDatabaseGroups();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return void
|
||||
|
||||
@@ -478,20 +478,6 @@ class SpacesContext implements Context {
|
||||
$this->archiverContext = BehatHelper::getContext($scope, $environment, 'ArchiverContext');
|
||||
}
|
||||
|
||||
/**
|
||||
* @AfterScenario
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws Exception|GuzzleException
|
||||
*/
|
||||
public function cleanDataAfterTests(): void {
|
||||
if (OcHelper::isTestingOnReva() || OcHelper::isUsingPreparedLdapUsers()) {
|
||||
return;
|
||||
}
|
||||
$this->deleteAllProjectSpaces();
|
||||
}
|
||||
|
||||
/**
|
||||
* the admin user first disables and then deletes spaces
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user