From 8434405fafa11d9f1ff5d01de943afb678a18202 Mon Sep 17 00:00:00 2001 From: PKiran <39373750+kiranparajuli589@users.noreply.github.com> Date: Wed, 13 Jul 2022 16:31:10 +0545 Subject: [PATCH] [tests-only] remove dedicated spaces cleanup for the localAPI tests (#4172) * No space cleanup in after scene Signed-off-by: Kiran Parajuli * Deleted method 'deleteAllSpacesOfTheType' Signed-off-by: Kiran Parajuli --- .../features/bootstrap/SpacesContext.php | 50 ------------------- 1 file changed, 50 deletions(-) diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 7c8bcac7d..2b3ee8a3a 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -24,9 +24,7 @@ declare(strict_types=1); use Behat\Behat\Context\Context; use Behat\Behat\Hook\Scope\BeforeScenarioScope; -use Behat\Behat\Hook\Call\AfterScenario; use Behat\Gherkin\Node\TableNode; -use Behat\Testwork\Environment\Environment; use GuzzleHttp\Exception\GuzzleException; use Psr\Http\Message\ResponseInterface; use TestHelpers\HttpRequestHelper; @@ -364,54 +362,6 @@ class SpacesContext implements Context { ); } - /** - * @AfterScenario - * - * @return void - * - * @throws Exception|GuzzleException - */ - public function cleanDataAfterTests(): void { - $this->deleteAllSpacesOfTheType('project'); - } - - /** - * The method first disables and then deletes spaces - * - * @param string $driveType - * - * @return void - * - * @throws Exception|GuzzleException - */ - public function deleteAllSpacesOfTheType(string $driveType): void { - $query = "\$filter=driveType eq $driveType"; - $userAdmin = $this->featureContext->getAdminUsername(); - - for ($i = 0; $i < 2; ++$i) { - $this->theUserListsAllAvailableSpacesUsingTheGraphApi( - $userAdmin, - $query - ); - - $rawBody = $this->featureContext->getResponse()->getBody()->getContents(); - $drives = json_decode($rawBody, true, 512); - if (isset($drives["value"])) { - $drives = $drives["value"]; - } - - if (!empty($drives)) { - foreach ($drives as $value) { - if (!\array_key_exists("deleted", $value["root"])) { - $this->sendDisableSpaceRequest($userAdmin, $value["name"]); - } else { - $this->sendDeleteSpaceRequest($userAdmin, $value["name"]); - } - } - } - } - } - /** * Send Graph List My Spaces Request *