[tests-only][full-ci] refactoring the user delete code from ocs to graphapi (#7020)

* addressing the reviews

* addressing the review

* refactored test code

* updated expected failures file
This commit is contained in:
Sabin Panta
2023-10-31 12:01:36 +05:45
committed by GitHub
parent b471895598
commit cc1f93eef1
4 changed files with 22 additions and 112 deletions
@@ -346,17 +346,14 @@ class GraphContext implements Context {
* @return void
* @throws GuzzleException
*/
public function adminDeletesUserUsingTheGraphApi(string $user, ?string $byUser = null): void {
public function adminDeletesUserUsingTheGraphApi(string $user, ?string $byUser = null): ResponseInterface {
$credentials = $this->getAdminOrUserCredentials($byUser);
$this->featureContext->setResponse(
GraphHelper::deleteUser(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$credentials["username"],
$credentials["password"],
$user
)
return GraphHelper::deleteUser(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$credentials["username"],
$credentials["password"],
$user
);
}
@@ -442,8 +439,8 @@ class GraphContext implements Context {
* @throws GuzzleException
*/
public function theUserHasDeletesAUserUsingTheGraphAPI(string $byUser, string $user): void {
$this->adminDeletesUserUsingTheGraphApi($user, $byUser);
$this->featureContext->thenTheHTTPStatusCodeShouldBe(204);
$response = $this->adminDeletesUserUsingTheGraphApi($user, $byUser);
$this->featureContext->theHttpStatusCodeShouldBe(204, "", $response);
}
/**