diff --git a/tests/acceptance/features/bootstrap/Provisioning.php b/tests/acceptance/features/bootstrap/Provisioning.php index 41d121df2dc..c1d57aab4ec 100644 --- a/tests/acceptance/features/bootstrap/Provisioning.php +++ b/tests/acceptance/features/bootstrap/Provisioning.php @@ -24,6 +24,7 @@ use GuzzleHttp\Exception\GuzzleException; use Psr\Http\Message\ResponseInterface; use PHPUnit\Framework\Assert; +use TestHelpers\GraphHelper; use TestHelpers\OcsApiHelper; use TestHelpers\UserHelper; use TestHelpers\HttpRequestHelper; @@ -3825,9 +3826,9 @@ public function theAdministratorDisablesTheFollowingUsersUsingTheProvisioningApi */ public function adminHasDisabledUserUsingTheProvisioningApi(?string $user):void { $user = $this->getActualUsername($user); - $this->disableOrEnableUser($this->getAdminUsername(), $user, 'disable'); - $this->theHTTPStatusCodeShouldBeSuccess(); - $this->ocsContext->assertOCSResponseIndicatesSuccess(); + $response=$this->disableOrEnableUser($this->getAdminUsername(), $user, null, null, null, null, false); + $this->setResponse($response); + $this->thenTheHTTPStatusCodeShouldBe(200); } /** @@ -5402,20 +5403,22 @@ public function rememberGroupsThatExistAtTheStartOfTheScenario():void { * * @return void */ - public function disableOrEnableUser(string $user, string $otherUser, string $action):void { + public function disableOrEnableUser(string $user, string $otherUser, string $userName = null, string $password = null, string $email = null, string $displayName = null, bool $accountEnabled = true):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( - $fullUrl, - $this->getStepLineRef(), - $actualUser, - $actualPassword - ); - $this->pushToLastStatusCodesArrays(); + $userId = $this->getAttributeOfCreatedUser($otherUser, 'id'); + return GraphHelper::editUser( + $this->getBaseUrl(), + $this->getStepLineRef(), + $actualUser, + $actualPassword, + $userId, + $userName, + $password, + $email, + $displayName, + $accountEnabled + ); } /** diff --git a/tests/acceptance/features/coreApiShareCreateSpecialToShares2/createShareWithDisabledUser.feature b/tests/acceptance/features/coreApiShareCreateSpecialToShares2/createShareWithDisabledUser.feature index bbccb7b1708..56fdea00638 100644 --- a/tests/acceptance/features/coreApiShareCreateSpecialToShares2/createShareWithDisabledUser.feature +++ b/tests/acceptance/features/coreApiShareCreateSpecialToShares2/createShareWithDisabledUser.feature @@ -14,7 +14,6 @@ Feature: share resources with a disabled user And user "Brian" has been created with default attributes and without skeleton files And user "Alice" has been disabled When user "Alice" shares file "textfile0.txt" with user "Brian" using the sharing API - Then the OCS status code should be "997" And the HTTP status code should be "401" @@ -23,6 +22,4 @@ Feature: share resources with a disabled user And user "Brian" has been created with default attributes and without skeleton files And user "Alice" has been disabled When user "Alice" shares file "textfile0.txt" with user "Brian" using the sharing API - Then the OCS status code should be "997" - #And the OCS status code should be "401" And the HTTP status code should be "401" diff --git a/tests/acceptance/features/coreApiWebdavOperations/refuseAccess.feature b/tests/acceptance/features/coreApiWebdavOperations/refuseAccess.feature index 8a44bc7ac1c..64127e0d03d 100644 --- a/tests/acceptance/features/coreApiWebdavOperations/refuseAccess.feature +++ b/tests/acceptance/features/coreApiWebdavOperations/refuseAccess.feature @@ -27,7 +27,7 @@ Feature: refuse access Given using DAV path And user "Alice" has been created with default attributes and without skeleton files And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "textfile0.txt" - And the user "Admin" has disabled user "Alice" using the Graph API + And user "Alice" has been disabled When user "Alice" downloads file "/textfile0.txt" using the WebDAV API Then the HTTP status code should be "401" Examples: