Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test-only] apiTest. delete users with their personal spaces after each test #4533

Merged
merged 2 commits into from
Sep 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions tests/acceptance/features/bootstrap/SpacesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,6 @@ public function setUpScenario(BeforeScenarioScope $scope): void {
*/
public function cleanDataAfterTests(): void {
$this->deleteAllProjectSpaces();
$this->deleteAllPersonalSpaces();
}

/**
Expand Down Expand Up @@ -518,33 +517,6 @@ public function deleteAllProjectSpaces(): void {
}
}

/**
* users delete their personal space at the end of the test
*
* @return void
*
* @throws Exception|GuzzleException
*/
public function deleteAllPersonalSpaces(): void {
$query = "\$filter=driveType eq personal";
$createdUsers = $this->featureContext->getCreatedUsers();
$userAdmin = $this->featureContext->getAdminUsername();

foreach ($createdUsers as $user) {
$this->theUserListsAllHisAvailableSpacesUsingTheGraphApi(
$user["actualUsername"],
$query
);
$drives = $this->getAvailableSpaces();
foreach ($drives as $value) {
if (!\array_key_exists("deleted", $value["root"])) {
$this->sendDisableSpaceRequest($userAdmin, $value["name"]);
}
$this->sendDeleteSpaceRequest($userAdmin, $value["name"]);
}
}
}

/**
* Send Propfind Request to Url
*
Expand Down