Skip to content

Commit

Permalink
Merge pull request #9569 from owncloud/tests/remote_item_id
Browse files Browse the repository at this point in the history
[tests-only][full-ci] add remote item-id check in REPORT responses
  • Loading branch information
saw-jan authored Jul 11, 2024
2 parents ea1e80a + 5b566e2 commit f807c4e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
16 changes: 9 additions & 7 deletions tests/acceptance/features/apiContract/sharesReport.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ Feature: REPORT request to Shares space
And the following headers should match these regular expressions
| X-Request-Id | /^[a-zA-Z]+\/[a-zA-Z]+\.feature:\d+(-\d+)?$/ |
And the "REPORT" response to user "Brian" should contain a mountpoint "folderMain" with these key and value pairs:
| key | value |
| oc:fileid | UUIDof:SubFolder1 |
| oc:file-parent | UUIDof:folderMain |
| oc:shareroot | /folderMain |
| oc:name | SubFolder1 |
| d:getcontenttype | httpd/unix-directory |
| oc:permissions | S |
| key | value |
| oc:fileid | UUIDof:SubFolder1 |
| oc:file-parent | UUIDof:folderMain |
| oc:shareroot | /folderMain |
| oc:name | SubFolder1 |
| d:getcontenttype | httpd/unix-directory |
| oc:permissions | S |
| oc:remote-item-id | UUIDof:folderMain |
Examples:
| dav-path-version |
| old |
Expand All @@ -55,6 +56,7 @@ Feature: REPORT request to Shares space
| d:getcontenttype | text/plain |
| oc:permissions | S |
| d:getcontentlength | 34 |
| oc:remote-item-id | UUIDof:folderMain |
Examples:
| dav-path-version |
| old |
Expand Down
18 changes: 10 additions & 8 deletions tests/acceptance/features/apiContract/spacesSharesReport.feature
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ Feature: Report test
And the following headers should match these regular expressions
| X-Request-Id | /^[a-zA-Z]+\/[a-zA-Z]+\.feature:\d+(-\d+)?$/ |
And the "REPORT" response to user "Brian" should contain a mountpoint "folderMain" with these key and value pairs:
| key | value |
| oc:fileid | UUIDof:SubFolder1 |
| oc:file-parent | UUIDof:folderMain |
| oc:shareroot | /folderMain |
| oc:name | SubFolder1 |
| d:getcontenttype | httpd/unix-directory |
| oc:permissions | S |
| oc:size | 12 |
| key | value |
| oc:fileid | UUIDof:SubFolder1 |
| oc:file-parent | UUIDof:folderMain |
| oc:shareroot | /folderMain |
| oc:name | SubFolder1 |
| d:getcontenttype | httpd/unix-directory |
| oc:permissions | S |
| oc:size | 12 |
| oc:remote-item-id | UUIDof:folderMain |


Scenario: check the response of the found file
Expand All @@ -61,6 +62,7 @@ Feature: Report test
| d:getcontenttype | text/plain |
| oc:permissions | SD |
| d:getcontentlength | 12 |
| oc:remote-item-id | UUIDof:folderMain |


Scenario: search for the shared folder when the share is not accepted
Expand Down
3 changes: 3 additions & 0 deletions tests/acceptance/features/bootstrap/SpacesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -3893,6 +3893,9 @@ public function theResponseShouldContain(string $method, string $user, string $s
Assert::assertTrue($responseValue >= ($value - 3));
}
break;
case "oc:remote-item-id":
Assert::assertContainsEquals($this->getResourceId($user, $spaceNameOrMountPoint, $value), $responseValues, 'wrong remoteItemId in the response');
break;
default:
Assert::assertContainsEquals($value, $responseValues, "wrong $findItem in the response");
break;
Expand Down

0 comments on commit f807c4e

Please sign in to comment.