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

[tests-only][full-ci] make user enable disable feature use graphapi #7077

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions tests/acceptance/expected-failures-API-on-OCIS-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -624,12 +624,6 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers
- [coreApiWebdavOperations/listFiles.feature:394](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavOperations/listFiles.feature#L394)
- [coreApiWebdavOperations/listFiles.feature:399](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavOperations/listFiles.feature#L399)

### [graph/users: enable/disable users](https://github.com/owncloud/ocis/issues/3064)

Comment on lines -627 to -628
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these tests fail in stable because of this #7087 but if the fix won't be backported to stable we can also skip these tests in stable. waiting for some decision on what to do

- [coreApiWebdavOperations/refuseAccess.feature:34](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavOperations/refuseAccess.feature#L34)
- [coreApiWebdavOperations/refuseAccess.feature:35](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavOperations/refuseAccess.feature#L35)
- [coreApiWebdavOperations/refuseAccess.feature:40](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavOperations/refuseAccess.feature#L40)

#### [OCS status code zero](https://github.com/owncloud/ocis/issues/3621)

- [coreApiShareManagementToShares/moveReceivedShare.feature:13](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareManagementToShares/moveReceivedShare.feature#L13)
Expand Down
20 changes: 14 additions & 6 deletions tests/acceptance/features/bootstrap/Provisioning.php
Original file line number Diff line number Diff line change
Expand Up @@ -3825,9 +3825,18 @@ public function theAdministratorDisablesTheFollowingUsersUsingTheProvisioningApi
*/
public function adminHasDisabledUserUsingTheProvisioningApi(?string $user):void {
$user = $this->getActualUsername($user);
$this->disableOrEnableUser($this->getAdminUsername(), $user, 'disable');
$this->theHTTPStatusCodeShouldBeSuccess();
$this->ocsContext->assertOCSResponseIndicatesSuccess();
if (OcisHelper::isTestingWithGraphApi()) {
$response = $this->graphContext->editUserUsingTheGraphApi($this->getAdminUsername(), $user, null, null, null, null, false);
} else {
$response = $this->disableOrEnableUser($this->getAdminUsername(), $user, 'disable');
}
Assert::assertEquals(
200,
$response->getStatusCode(),
__METHOD__
. " Expected status code is 200 but received " . $response->getStatusCode()
. "\nResponse body: " . $response->getBody(),
);
}

/**
Expand Down Expand Up @@ -5402,20 +5411,19 @@ public function rememberGroupsThatExistAtTheStartOfTheScenario():void {
*
* @return void
*/
public function disableOrEnableUser(string $user, string $otherUser, string $action):void {
public function disableOrEnableUser(string $user, string $otherUser, string $action): ResponseInterface {
$actualUser = $this->getActualUsername($user);
$actualPassword = $this->getPasswordForUser($actualUser);
$actualOtherUser = $this->getActualUsername($otherUser);

$fullUrl = $this->getBaseUrl()
. "/ocs/v$this->ocsApiVersion.php/cloud/users/$actualOtherUser/$action";
$this->response = HttpRequestHelper::put(
return HttpRequestHelper::put(
$fullUrl,
$this->getStepLineRef(),
$actualUser,
$actualPassword
);
$this->pushToLastStatusCodesArrays();
}

/**
Expand Down