summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-10-13 10:53:04 +0200
committerMorris Jobke <hey@morrisjobke.de>2016-12-02 00:50:32 +0100
commitf07c209cb9372e256d4e18e845c9116f8376b6c3 (patch)
tree3e00eefbd6afaa6bede14ad3d75035fc83e9bb41 /apps/files_sharing
parent1c4a1b880767f986eac8793b655a0591c0f26720 (diff)
downloadnextcloud-server-f07c209cb9372e256d4e18e845c9116f8376b6c3.tar.gz
nextcloud-server-f07c209cb9372e256d4e18e845c9116f8376b6c3.zip
Fix post_unshareFromSelf hook parameter format
When unsharing from self in a group share situation, the share items passed to the post_unshareFromSelf hook were using the wrong format in which the attribute names (ex: "share_type") have non camel-case format. This fix makes sure that in group sharing case we use the correct format. It looks like the code was already producing it but in array_merge it was not using it and adding the unprocessed one.
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/tests/GroupEtagPropagationTest.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/files_sharing/tests/GroupEtagPropagationTest.php b/apps/files_sharing/tests/GroupEtagPropagationTest.php
index 0ff3a4c01c6..85af774c71a 100644
--- a/apps/files_sharing/tests/GroupEtagPropagationTest.php
+++ b/apps/files_sharing/tests/GroupEtagPropagationTest.php
@@ -122,4 +122,26 @@ class GroupEtagPropagationTest extends PropagationTestCase {
$this->assertAllUnchanged();
}
+
+ public function testRecipientUnsharesFromSelf() {
+ $this->loginAsUser(self::TEST_FILES_SHARING_API_USER2);
+ $this->assertTrue(
+ $this->rootView->unlink('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/test')
+ );
+ $this->assertEtagsChanged([self::TEST_FILES_SHARING_API_USER2]);
+
+ $this->assertAllUnchanged();
+ }
+
+ public function testRecipientUnsharesFromSelfUniqueGroupShare() {
+ $this->loginAsUser(self::TEST_FILES_SHARING_API_USER2);
+ // rename to create an extra entry in the share table
+ $this->rootView->rename('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/test', '/' . self::TEST_FILES_SHARING_API_USER2 . '/files/test_renamed');
+ $this->assertTrue(
+ $this->rootView->unlink('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/test_renamed')
+ );
+ $this->assertEtagsChanged([self::TEST_FILES_SHARING_API_USER2]);
+
+ $this->assertAllUnchanged();
+ }
}