diff options
author | Sergio BertolĂn <sbertolin@solidgear.es> | 2016-08-30 06:47:39 +0000 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-10-06 13:57:54 +0200 |
commit | 7744cb5240c4aa9f974ae7198a1c0a31c92d19a9 (patch) | |
tree | a7503a39b422c2bb7eb7544f91d70197a6725868 /build | |
parent | 4873f0800beb13204648267744e1b6a02abea18c (diff) | |
download | nextcloud-server-7744cb5240c4aa9f974ae7198a1c0a31c92d19a9.tar.gz nextcloud-server-7744cb5240c4aa9f974ae7198a1c0a31c92d19a9.zip |
Orphaned shares test and some requirements
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'build')
-rw-r--r-- | build/integration/features/bootstrap/BasicStructure.php | 31 | ||||
-rw-r--r-- | build/integration/features/bootstrap/WebDav.php | 2 | ||||
-rw-r--r-- | build/integration/features/sharing-v1.feature | 18 |
3 files changed, 50 insertions, 1 deletions
diff --git a/build/integration/features/bootstrap/BasicStructure.php b/build/integration/features/bootstrap/BasicStructure.php index 30d78ebd23a..a8438927731 100644 --- a/build/integration/features/bootstrap/BasicStructure.php +++ b/build/integration/features/bootstrap/BasicStructure.php @@ -179,6 +179,27 @@ trait BasicStructure { } } + public function sendingToWithDirectUrl($verb, $url, $body) { + $fullUrl = substr($this->baseUrl, 0, -5) . $url; + $client = new Client(); + $options = []; + if ($this->currentUser === 'admin') { + $options['auth'] = $this->adminUser; + } else { + $options['auth'] = [$this->currentUser, $this->regularUser]; + } + if ($body instanceof \Behat\Gherkin\Node\TableNode) { + $fd = $body->getRowsHash(); + $options['body'] = $fd; + } + + try { + $this->response = $client->send($client->createRequest($verb, $fullUrl, $options)); + } catch (\GuzzleHttp\Exception\ClientException $ex) { + $this->response = $ex->getResponse(); + } + } + public function isExpectedUrl($possibleUrl, $finalPart){ $baseUrlChopped = substr($this->baseUrl, 0, -4); $endCharacter = strlen($baseUrlChopped) + strlen($finalPart); @@ -321,6 +342,16 @@ trait BasicStructure { } /** + * @When User :user empties trashbin + * @param string $user + */ + public function emptyTrashbin($user) { + $body = new \Behat\Gherkin\Node\TableNode([['allfiles', 'true'], ['dir', '%2F']]); + $this->sendingToWithDirectUrl('POST', "/index.php/apps/files_trashbin/ajax/delete.php", $body); + $this->theHTTPStatusCodeShouldBe('200'); + } + + /** * @BeforeSuite */ public static function addFilesToSkeleton(){ diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php index ad29f28e105..5eccfdf2f85 100644 --- a/build/integration/features/bootstrap/WebDav.php +++ b/build/integration/features/bootstrap/WebDav.php @@ -455,7 +455,7 @@ trait WebDav { } /** - * @When User :user deletes file :file + * @When User :user deletes (file|folder) :file * @param string $user * @param string $file */ diff --git a/build/integration/features/sharing-v1.feature b/build/integration/features/sharing-v1.feature index 3c769fba3df..ab1b9c63ccd 100644 --- a/build/integration/features/sharing-v1.feature +++ b/build/integration/features/sharing-v1.feature @@ -920,3 +920,21 @@ Feature: sharing # |{http://owncloud.org/ns}permissions| # And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK" # And as "user1" the folder "merge-test-outside-groups-renamebeforesecondshare" does not exist + + Scenario: Empting trashbin + Given As an "admin" + And user "user0" exists + And User "user0" deletes file "/textfile0.txt" + When User "user0" empties trashbin + Then the HTTP status code should be "200" + + Scenario: orphaned shares + Given As an "admin" + And user "user0" exists + And user "user1" exists + And user "user0" created a folder "/common" + And user "user0" created a folder "/common/sub" + And file "/common/sub" of user "user0" is shared with user "user1" + And User "user0" deletes folder "/common" + When User "user0" empties trashbin + Then as "user1" the folder "sub" does not exist |