diff --git a/tests/acceptance/features/bootstrap/Provisioning.php b/tests/acceptance/features/bootstrap/Provisioning.php index 04bbad86c4f..844aad3a660 100644 --- a/tests/acceptance/features/bootstrap/Provisioning.php +++ b/tests/acceptance/features/bootstrap/Provisioning.php @@ -4559,21 +4559,19 @@ public function theFollowingUsersShouldBeEnabled(TableNode $table):void { */ public function adminSetsUserQuotaToUsingTheProvisioningApi(string $user, string $quota):void { $user = $this->getActualUsername($user); - $body - = [ - 'key' => 'quota', - 'value' => $quota, - ]; - - $this->response = OcsApiHelper::sendRequest( - $this->getBaseUrl(), - $this->getAdminUsername(), - $this->getAdminPassword(), - "PUT", - "/cloud/users/$user", - $this->getStepLineRef(), - $body - ); + $adminUser = $this->getAdminUsername(); + $bodyData = ["quota" => ["total" => (int)$quota]]; + $spaceId = $this->spacesContext->getSpaceIdByName($user, "Personal"); + $body = json_encode($bodyData, JSON_THROW_ON_ERROR); + if (OcisHelper::isTestingWithGraphApi()) { + $this->response = GraphHelper::updateSpace( + $this->getBaseUrl(), + $adminUser, + $this->getAdminPassword(), + $body, + $spaceId + ); + } } /** @@ -4597,7 +4595,7 @@ public function theQuotaOfUserHasBeenSetTo(string $user, string $quota):void { * @return void */ public function adminGivesUnlimitedQuotaToUserUsingTheProvisioningApi(string $user):void { - $this->adminSetsUserQuotaToUsingTheProvisioningApi($user, 'none'); + $this->adminSetsUserQuotaToUsingTheProvisioningApi($user, '0'); } /** diff --git a/tests/acceptance/features/coreApiShareOperationsToShares2/uploadToShare.feature b/tests/acceptance/features/coreApiShareOperationsToShares2/uploadToShare.feature index 0661926f967..a076c55ef42 100644 --- a/tests/acceptance/features/coreApiShareOperationsToShares2/uploadToShare.feature +++ b/tests/acceptance/features/coreApiShareOperationsToShares2/uploadToShare.feature @@ -165,7 +165,7 @@ Feature: sharing @skipOnGraph Scenario Outline: uploading to a user shared folder with read/write permission when the sharer has insufficient quota does not work Given using DAV path - And user "Brian" has been created with default attributes and small skeleton files + And user "Brian" has been created with default attributes and without skeleton files And user "Alice" has created folder "FOLDER" And user "Alice" has created a share with settings | path | FOLDER | diff --git a/tests/acceptance/features/coreApiWebdavProperties1/getQuota.feature b/tests/acceptance/features/coreApiWebdavProperties1/getQuota.feature index 631b7d9d275..3cfac65ef1c 100644 --- a/tests/acceptance/features/coreApiWebdavProperties1/getQuota.feature +++ b/tests/acceptance/features/coreApiWebdavProperties1/getQuota.feature @@ -1,4 +1,4 @@ -@issue-1313 @skipOnGraph +@issue-1313 Feature: get quota As a user I want to be able to find out my available storage quota @@ -13,7 +13,7 @@ Feature: get quota Given using DAV path When the administrator gives unlimited quota to user "Alice" using the provisioning API Then the HTTP status code should be "200" - And as user "Alice" folder "/" should contain a property "d:quota-available-bytes" with value "-3" + And as user "Alice" folder "/" should contain a property "d:quota-available-bytes" with value "0" Examples: | dav-path-version | | old | @@ -23,9 +23,9 @@ Feature: get quota @smokeTest Scenario Outline: retrieving folder quota when quota is set Given using DAV path - When the administrator sets the quota of user "Alice" to "10 MB" using the provisioning API + When the administrator sets the quota of user "Alice" to "10000" using the provisioning API Then the HTTP status code should be "200" - And as user "Alice" folder "/" should contain a property "d:quota-available-bytes" with value "10485406" + And as user "Alice" folder "/" should contain a property "d:quota-available-bytes" with value "10000" Examples: | dav-path-version | | old | @@ -37,34 +37,34 @@ Feature: get quota Given using DAV path And user "Brian" has been created with default attributes and without skeleton files And user "Alice" has been given unlimited quota - And the quota of user "Brian" has been set to "10 MB" + And the quota of user "Brian" has been set to "10000" And user "Brian" has created folder "/testquota" And user "Brian" has created a share with settings | path | testquota | | shareType | user | | permissions | all | | shareWith | Alice | - When user "Alice" gets the following properties of folder "/testquota" using the WebDAV API + When user "Alice" gets the following properties of folder "" inside space "Shares" using the WebDAV API | propertyName | | d:quota-available-bytes | - Then the HTTP status code should be "200" - And the single response should contain a property "d:quota-available-bytes" with value "10485406" + Then the HTTP status code should be "207" + And the single response should contain a property "d:quota-available-bytes" with value "10000" Examples: - | dav-path-version | - | old | - | new | - | spaces | + | dav-path-version | folder-path | + | old | /Shares/testquota | + | new | /Shares/testquota | + | spaces | /testquota | Scenario Outline: retrieving folder quota when quota is set and a file was uploaded Given using DAV path - And the quota of user "Alice" has been set to "1 KB" + And the quota of user "Alice" has been set to "10000" And user "Alice" has uploaded file "/prueba.txt" of size 93 bytes When user "Alice" gets the following properties of folder "/" using the WebDAV API | propertyName | | d:quota-available-bytes | - Then the HTTP status code should be "201" - And the single response should contain a property "d:quota-available-bytes" with value "577" + Then the HTTP status code should be "207" + And the single response should contain a property "d:quota-available-bytes" with value "10000" Examples: | dav-path-version | | old | @@ -75,14 +75,14 @@ Feature: get quota Scenario Outline: retrieving folder quota when quota is set and a file was received Given using DAV path And user "Brian" has been created with default attributes and without skeleton files - And the quota of user "Brian" has been set to "1 KB" + And the quota of user "Brian" has been set to "10000" And user "Alice" has uploaded file "/Alice.txt" of size 93 bytes And user "Alice" has shared file "Alice.txt" with user "Brian" When user "Brian" gets the following properties of folder "/" using the WebDAV API | propertyName | | d:quota-available-bytes | - Then the HTTP status code should be "200" - And the single response should contain a property "d:quota-available-bytes" with value "670" + Then the HTTP status code should be "207" + And the single response should contain a property "d:quota-available-bytes" with value "10000" Examples: | dav-path-version | | old |