diff options
author | Robin Appelman <robin@icewind.nl> | 2018-09-12 15:28:03 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2018-09-20 17:03:59 +0200 |
commit | d890cd6a4cbd132564ce76445335e026518b60d6 (patch) | |
tree | 5c2623c3487e01ac22a425429d125bda99c4d8b3 /build | |
parent | 073fddcc28921113de946722a8f11ddcaac7a0d4 (diff) | |
download | nextcloud-server-d890cd6a4cbd132564ce76445335e026518b60d6.tar.gz nextcloud-server-d890cd6a4cbd132564ce76445335e026518b60d6.zip |
fix sharing trashbin integration tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'build')
-rw-r--r-- | build/integration/features/bootstrap/Trashbin.php | 20 | ||||
-rw-r--r-- | build/integration/features/sharing-v1-part3.feature | 6 |
2 files changed, 23 insertions, 3 deletions
diff --git a/build/integration/features/bootstrap/Trashbin.php b/build/integration/features/bootstrap/Trashbin.php index fd90a726421..8e4d0892bc8 100644 --- a/build/integration/features/bootstrap/Trashbin.php +++ b/build/integration/features/bootstrap/Trashbin.php @@ -119,6 +119,26 @@ trait Trashbin { } /** + * @Then /^as "([^"]*)" the (file|folder) "([^"]*)" exists in trash$/ + * @param string $user + * @param string $type + * @param string $file + */ + public function checkTrashContains($user, $type, $file) { + $parent = dirname($file); + if ($parent === '.') { + $parent = '/'; + } + $name = basename($file); + $elementList = $this->listTrashbinFolder($user, $parent); + $trashContent = array_filter(array_map(function (array $item) { + return $item['{http://nextcloud.org/ns}trashbin-filename']; + }, $elementList)); + + Assert::assertArraySubset([$name], array_values($trashContent)); + } + + /** * @Then /^user "([^"]*)" in trash folder "([^"]*)" should have (\d+) elements?$/ * @param string $user * @param string $folder diff --git a/build/integration/features/sharing-v1-part3.feature b/build/integration/features/sharing-v1-part3.feature index 44a41341a02..6ab7cfdf9a0 100644 --- a/build/integration/features/sharing-v1-part3.feature +++ b/build/integration/features/sharing-v1-part3.feature @@ -1,7 +1,7 @@ Feature: sharing Background: Given using api version "1" - Given using old dav path + Given using new dav path # See sharing-v1-part2.feature @@ -295,7 +295,7 @@ Feature: sharing And user "user0" exists And User "user0" deletes file "/textfile0.txt" When User "user0" empties trashbin - Then the HTTP status code should be "200" + Then the HTTP status code should be "204" Scenario: orphaned shares Given As an "admin" @@ -392,4 +392,4 @@ Feature: sharing And folder "/shared" of user "user0" is shared with user "user1" When User "user1" moved file "/textfile0.txt" to "/shared/shared_file.txt" Then as "user1" the file "/shared/shared_file.txt" exists - And as "user0" the file "/shared/shared_file.txt" exists
\ No newline at end of file + And as "user0" the file "/shared/shared_file.txt" exists |