[tests-only][full-ci]added test for declining a share (#8636)

* added test for declining a share

* updated step definition for disabling user

* addressing review
This commit is contained in:
Sabin Panta
2024-03-21 14:03:09 +05:45
committed by GitHub
parent ec8a4a044b
commit 25fa79d54a
5 changed files with 122 additions and 0 deletions
@@ -184,6 +184,7 @@ class FeatureContext extends BehatVariablesContext {
*/
private bool $dbConversion = false;
public const SHARES_SPACE_ID = 'a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668';
/**
* @param bool $value
*
@@ -2536,6 +2536,7 @@ class GraphContext implements Context {
$credentials['password']
)
);
$this->featureContext->pushToLastStatusCodesArrays();
}
/**
@@ -559,4 +559,39 @@ class SharingNgContext implements Context {
Assert::assertSame($should, $fileFound, $assertMessage);
}
/**
*
* @param string $user
* @param string $itemId
* @param string $shareSpaceId
*
* @return ResponseInterface
*/
public function unmountShare(string $user, string $itemId, string $shareSpaceId): ResponseInterface {
return GraphHelper::unmountShare(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$this->featureContext->getActualUsername($user),
$this->featureContext->getPasswordForUser($user),
$itemId,
$shareSpaceId,
);
}
/**
* @When user :user unmounts share :share using the Graph API
*
* @param string $user
*
* @return void
* @throws Exception
*/
public function userUnmountsShareUsingTheGraphApi(string $user):void {
$shareItemId = $this->featureContext->shareNgGetLastCreatedUserGroupShareID();
$shareSpaceId = FeatureContext::SHARES_SPACE_ID;
$itemId = $shareSpaceId . '!' . $shareItemId;
$this->featureContext->setResponse($this->unmountShare($user, $itemId, $shareSpaceId));
$this->featureContext->pushToLastStatusCodesArrays();
}
}