Skip to content
Merged
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: 3 additions & 3 deletions tests/acceptance/features/apiFederation/federated.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Feature: federated
When user "user1" from server "LOCAL" shares "/textfile0.txt" with user "user0" from server "REMOTE" using the sharing API
Then the OCS status code should be "<ocs-status>"
And the HTTP status code should be "200"
And the share fields of the last share should include
And the fields of the last response should include
| id | A_NUMBER |
| item_type | file |
| item_source | A_NUMBER |
Expand All @@ -38,7 +38,7 @@ Feature: federated
When user "user0" from server "REMOTE" shares "/textfile0.txt" with user "user1" from server "LOCAL" using the sharing API
Then the OCS status code should be "<ocs-status>"
And the HTTP status code should be "200"
And the share fields of the last share should include
And the fields of the last response should include
| id | A_NUMBER |
| item_type | file |
| item_source | A_NUMBER |
Expand Down Expand Up @@ -172,7 +172,7 @@ Feature: federated
| permissions | 19 |
Then the OCS status code should be "<ocs-status>"
And the HTTP status code should be "200"
And the share fields of the last share should include
And the fields of the last response should include
| id | A_NUMBER |
| item_type | file |
| item_source | A_NUMBER |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Feature: external-storage
| path | foo |
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And the share fields of the last share should include
And the fields of the last response should include
| id | A_NUMBER |
| url | AN_URL |
| token | A_TOKEN |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Feature: sharing
When user "user0" shares file "welcome.txt" with user "user1" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the share fields of the last share should include
And the fields of the last response should include
| share_with | user1 |
| file_target | /welcome.txt |
| path | /welcome.txt |
Expand All @@ -30,7 +30,7 @@ Feature: sharing
When user "user0" shares file "/welcome.txt" with group "grp1" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the share fields of the last share should include
And the fields of the last response should include
| share_with | grp1 |
| file_target | /welcome.txt |
| path | /welcome.txt |
Expand All @@ -50,7 +50,7 @@ Feature: sharing
When user "user0" shares file "/welcome.txt" with user "user1" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the share fields of the last share should include
And the fields of the last response should include
| share_with | user1 |
| file_target | /welcome.txt |
| path | /welcome.txt |
Expand Down Expand Up @@ -96,7 +96,7 @@ Feature: sharing
| permissions | 31 |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the share fields of the last share should include
And the fields of the last response should include
| file_target | /welcome.txt |
| path | /welcome.txt |
| item_type | file |
Expand Down Expand Up @@ -130,7 +130,7 @@ Feature: sharing
| path | welcome.txt |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the share fields of the last share should include
And the fields of the last response should include
| file_target | /welcome.txt |
| path | /welcome.txt |
| item_type | file |
Expand Down Expand Up @@ -173,7 +173,7 @@ Feature: sharing
| path | /afolder |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the share fields of the last share should include
And the fields of the last response should include
| id | A_NUMBER |
| share_type | 3 |
| permissions | 1 |
Expand All @@ -191,7 +191,7 @@ Feature: sharing
| path | /afolder |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the share fields of the last share should include
And the fields of the last response should include
| id | A_NUMBER |
| share_type | 3 |
| permissions | 1 |
Expand All @@ -209,7 +209,7 @@ Feature: sharing
| permissions | 15 |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the share fields of the last share should include
And the fields of the last response should include
| id | A_NUMBER |
| share_type | 3 |
| permissions | 15 |
Expand All @@ -227,7 +227,7 @@ Feature: sharing
| permissions | 5 |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the share fields of the last share should include
And the fields of the last response should include
| id | A_NUMBER |
| share_type | 3 |
| permissions | 5 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ Feature: sharing
And user "user0" has shared folder "/folder1" with user "user1" with permissions 31
And user "user1" has shared folder "/folder1/folder2" with user "user2" with permissions 31
When user "user1" moves folder "/folder1/folder2" to "/moved-out/folder2" using the WebDAV API
Then the share fields of the last share should include

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this actually used to be 🐍 🛢️ as the share fields of the last share should include would not check the current status but the status saved when creating the share

And user "user1" gets the info of the last share using the sharing API
Then the fields of the last response should include
| id | A_NUMBER |
| item_type | folder |
| item_source | A_NUMBER |
Expand All @@ -342,7 +343,8 @@ Feature: sharing
And user "user0" has shared folder "/user0-folder" with user "user1" with permissions 31
And user "user2" has shared folder "/user2-folder" with user "user1" with permissions 31
When user "user1" moves folder "/user0-folder/folder2" to "/user2-folder/folder2" using the WebDAV API
Then the share fields of the last share should include
And user "user2" gets the info of the last share using the sharing API
Then the fields of the last response should include
| id | A_NUMBER |
| item_type | folder |
| item_source | A_NUMBER |
Expand Down Expand Up @@ -451,8 +453,8 @@ Feature: sharing
| permissions | 7 |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
When the user gets the info of the last share using the sharing API
Then the share fields of the last share should include
When user "user0" gets the info of the last share using the sharing API
Then the fields of the last response should include
| permissions | 7 |
When the public deletes file "CHILD/child.txt" from the last public share using the public WebDAV API
Then the HTTP status code should be "403"
Expand All @@ -471,8 +473,8 @@ Feature: sharing
| permissions | 15 |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
When the user gets the info of the last share using the sharing API
Then the share fields of the last share should include
When user "user0" gets the info of the last share using the sharing API
Then the fields of the last response should include
| permissions | 15 |
When the public deletes file "CHILD/child.txt" from the last public share using the public WebDAV API
Then the HTTP status code should be "204"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Feature: sharing
When user "user0" gets the info of the last share using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the share fields of the last share should include
And the fields of the last response should include
| id | A_NUMBER |
| item_type | file |
| item_source | A_NUMBER |
Expand Down
34 changes: 0 additions & 34 deletions tests/acceptance/features/bootstrap/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@ public function userUpdatesTheLastShareWith($user, $body) {
$this->response = HttpRequestHelper::put(
$fullUrl, $user, $this->getPasswordForUser($user), null, $fd
);
$this->lastShareData = $this->getResponseXml();
}

/**
Expand Down Expand Up @@ -690,17 +689,6 @@ public function isFieldInResponse($field, $contentExpected, $data = null) {
}
}

/**
* @param string $field
* @param string $contentExpected
*
* @return bool
*/
public function isFieldInShareResponse($field, $contentExpected) {
$data = $this->lastShareData->data[0];
return $this->isFieldInResponse($field, $contentExpected, $data);
}

/**
* @Then /^file "([^"]*)" should be included in the response$/
*
Expand Down Expand Up @@ -1308,28 +1296,6 @@ public function checkingTheResponseEntriesCount($count) {
PHPUnit\Framework\Assert::assertEquals($count, $actualCount);
}

/**
* @Then /^the share fields of the last share should include$/
*
* @param TableNode|null $body
*
* @return void
*/
public function checkShareFields($body) {
if ($body instanceof TableNode) {
$fd = $body->getRowsHash();

foreach ($fd as $field => $value) {
$value = $this->replaceValuesFromTable($field, $value);
if (!$this->isFieldInShareResponse($field, $value)) {
PHPUnit\Framework\Assert::fail(
"$field doesn't have value $value"
);
}
}
}
}

/**
* @Then the fields of the last response should include
*
Expand Down