Skip to content

Commit 4f8fd47

Browse files
committed
adding test for editing shared file(OCM) by the share receiver
1 parent 46d397d commit 4f8fd47

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

tests/acceptance/bootstrap/SpacesContext.php

+27
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,33 @@ public function theUserUploadsAFileToSpace(
13451345
$this->featureContext->setResponse($response);
13461346
}
13471347

1348+
/**
1349+
* @When user :user updates the content of federated share :share with :content using the WebDAV API
1350+
*
1351+
* @param string $user
1352+
* @param string $share
1353+
* @param string $content
1354+
*
1355+
* @return void
1356+
* @throws GuzzleException
1357+
* @throws Exception
1358+
*/
1359+
public function userUpdatesTheContentOfFederatedShareWithUsingTheWebdavApi(
1360+
string $user,
1361+
string $share,
1362+
string $content,
1363+
): void {
1364+
$spaceId = $this->getSharesRemoteItemId($user, $share);
1365+
$this->featureContext->setResponse(
1366+
$this->featureContext->uploadFileWithContent(
1367+
$user,
1368+
$content,
1369+
'',
1370+
$spaceId
1371+
)
1372+
);
1373+
}
1374+
13481375
/**
13491376
* @When /^user "([^"]*)" uploads a file "([^"]*)" to "([^"]*)" in space "([^"]*)" using the WebDAV API$/
13501377
*

tests/acceptance/features/apiOcm/share.feature

+23
Original file line numberDiff line numberDiff line change
@@ -753,3 +753,26 @@ Feature: an user shares resources using ScienceMesh application
753753
Then the HTTP status code should be "200"
754754
And the downloaded image should be "32" pixels wide and "32" pixels high
755755
And the downloaded preview content should match with "thumbnail.png" fixtures preview content
756+
757+
@issue-10358
758+
Scenario: user edits content of a federated share file
759+
Given using spaces DAV path
760+
And using server "LOCAL"
761+
And "Alice" has created the federation share invitation
762+
And using server "REMOTE"
763+
And "Brian" has accepted invitation
764+
And using server "LOCAL"
765+
And user "Alice" has uploaded file with content "ocm test" to "/textfile.txt"
766+
And user "Alice" has sent the following resource share invitation to federated user:
767+
| resource | textfile.txt |
768+
| space | Personal |
769+
| sharee | Brian |
770+
| shareType | user |
771+
| permissionsRole | File Editor |
772+
And using server "REMOTE"
773+
And for user "Brian" the content of file "textfile.txt" of federated share "textfile.txt" should be "ocm test"
774+
When user "Brian" updates the content of federated share "textfile.txt" with "this is a new content" using the WebDAV API
775+
Then the HTTP status code should be "204"
776+
And for user "Brian" the content of file "textfile.txt" of federated share "textfile.txt" should be "this is a new content"
777+
And using server "LOCAL"
778+
And for user "Alice" the content of the file "textfile.txt" of the space "Personal" should be "this is a new content"

0 commit comments

Comments
 (0)