diff options
author | Sergio Bertolin <sbertolin@solidgear.es> | 2016-04-14 12:27:17 +0000 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2016-06-09 13:50:28 +0200 |
commit | 91082578ab89ec059f477f9f0dd5c44cdeaf913c (patch) | |
tree | 935f0c122ef165b6722851b509d163dab8020105 /build | |
parent | b928305bb30ade5635a203408090f4ae376278ba (diff) | |
download | nextcloud-server-91082578ab89ec059f477f9f0dd5c44cdeaf913c.tar.gz nextcloud-server-91082578ab89ec059f477f9f0dd5c44cdeaf913c.zip |
Added tests about overwriting files and folders as recipient
Diffstat (limited to 'build')
3 files changed, 42 insertions, 1 deletions
diff --git a/build/integration/features/bootstrap/BasicStructure.php b/build/integration/features/bootstrap/BasicStructure.php index b8fb516fada..9248b2cd252 100644 --- a/build/integration/features/bootstrap/BasicStructure.php +++ b/build/integration/features/bootstrap/BasicStructure.php @@ -261,6 +261,17 @@ trait BasicStructure { } /** + * @Given User :user modifies text of :filename with text :text + * @param string $user + * @param string $filename + * @param string $text + */ + public function modifyTextOfFile($user, $filename, $text) { + self::removeFile("../../data/$user/files", "$filename"); + file_put_contents("../../data/$user/files" . "$filename", "$text"); + } + + /** * @BeforeSuite */ public static function addFilesToSkeleton(){ diff --git a/build/integration/features/bootstrap/FederationContext.php b/build/integration/features/bootstrap/FederationContext.php index 2809c6974fa..55f3a55da0d 100644 --- a/build/integration/features/bootstrap/FederationContext.php +++ b/build/integration/features/bootstrap/FederationContext.php @@ -12,7 +12,7 @@ require __DIR__ . '/../../vendor/autoload.php'; */ class FederationContext implements Context, SnippetAcceptingContext { - use Sharing; + use WebDav; /** * @Given /^User "([^"]*)" from server "(LOCAL|REMOTE)" shares "([^"]*)" with user "([^"]*)" from server "(LOCAL|REMOTE)"$/ diff --git a/build/integration/federation_features/federated.feature b/build/integration/federation_features/federated.feature index acd1f91e908..7dcf97e5764 100644 --- a/build/integration/federation_features/federated.feature +++ b/build/integration/federation_features/federated.feature @@ -120,6 +120,36 @@ Feature: federated | share_with | user2 | | share_with_displayname | user2 | + Scenario: Overwrite a federated shared file as recipient + Given Using server "REMOTE" + And user "user1" exists + And user "user2" exists + And Using server "LOCAL" + And user "user0" exists + And User "user0" from server "LOCAL" shares "/textfile0.txt" with user "user1" from server "REMOTE" + And User "user1" from server "REMOTE" accepts last pending share + And Using server "REMOTE" + And As an "user1" + And User "user1" modifies text of "/textfile0.txt" with text "BLABLABLA" + When User "user1" uploads file "../../data/user1/files/textfile0.txt" to "/textfile0 (2).txt" + And Downloading file "/textfile0 (2).txt" with range "bytes=0-8" + Then Downloaded content should be "BLABLABLA" + + Scenario: Overwrite a federated shared folder as recipient + Given Using server "REMOTE" + And user "user1" exists + And user "user2" exists + And Using server "LOCAL" + And user "user0" exists + And User "user0" from server "LOCAL" shares "/PARENT" with user "user1" from server "REMOTE" + And User "user1" from server "REMOTE" accepts last pending share + And Using server "REMOTE" + And As an "user1" + And User "user1" modifies text of "/textfile0.txt" with text "BLABLABLA" + When User "user1" uploads file "../../data/user1/files/textfile0.txt" to "/PARENT (2)/textfile0.txt" + And Downloading file "/PARENT (2)/textfile0.txt" with range "bytes=0-8" + Then Downloaded content should be "BLABLABLA" + |