forward-port of relative quota amount of personal space tests from stable-2.0 (#5524)

This commit is contained in:
Roshan Lamichhane
2023-02-07 16:55:26 +05:45
committed by GitHub
parent a2798f26be
commit 19e1d63dab
3 changed files with 58 additions and 0 deletions
@@ -3226,4 +3226,27 @@ class SpacesContext implements Context {
)
);
}
/**
* @Then the relative quota amount should be :quota_amount
*
* @param string $quotaAmount
*
* @return void
* @throws Exception
*/
public function theRelativeQuotaAmountShouldBe(string $quotaAmount): void {
$data = $this->ocsContext->getOCSResponseData($this->featureContext->getResponse());
if (isset($data->quota, $data->quota->relative)) {
Assert::assertEquals(
$data->quota->relative,
$quotaAmount,
"Expected relative quota amount to be $quotaAmount but found to be $data->quota->relative"
);
} else {
throw new Exception(
"No relative quota amount found in responseXml"
);
}
}
}