summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-06-23 14:31:41 +0200
committerRobin Appelman <icewind@owncloud.com>2015-06-24 18:16:03 +0200
commitf847d9409e8864d732151b904f826be6c1228dcd (patch)
tree18c8c1a075694cba477a76ab64525e0ce43d9073 /apps
parent7a3cfbc3c8d7e2453e962ace592212f00148176e (diff)
downloadnextcloud-server-f847d9409e8864d732151b904f826be6c1228dcd.tar.gz
nextcloud-server-f847d9409e8864d732151b904f826be6c1228dcd.zip
add unit test for single file share etag propagation
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/tests/etagpropagation.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/files_sharing/tests/etagpropagation.php b/apps/files_sharing/tests/etagpropagation.php
index 60b7c525e35..710d7125340 100644
--- a/apps/files_sharing/tests/etagpropagation.php
+++ b/apps/files_sharing/tests/etagpropagation.php
@@ -69,9 +69,12 @@ class EtagPropagation extends TestCase {
$view1->mkdir('/directReshare');
$view1->mkdir('/sub1/sub2/folder/other');
$view1->mkdir('/sub1/sub2/folder/other');
+ $view1->file_put_contents('/foo.txt', 'foobar');
$view1->file_put_contents('/sub1/sub2/folder/file.txt', 'foobar');
$view1->file_put_contents('/sub1/sub2/folder/inside/file.txt', 'foobar');
$folderInfo = $view1->getFileInfo('/sub1/sub2/folder');
+ $fileInfo = $view1->getFileInfo('/foo.txt');
+ \OCP\Share::shareItem('file', $fileInfo->getId(), \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2, 31);
\OCP\Share::shareItem('folder', $folderInfo->getId(), \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2, 31);
\OCP\Share::shareItem('folder', $folderInfo->getId(), \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER3, 31);
$folderInfo = $view1->getFileInfo('/directReshare');
@@ -179,6 +182,15 @@ class EtagPropagation extends TestCase {
$this->assertAllUnchaged();
}
+ public function testOwnerWritesToSingleFileShare() {
+ $this->loginAsUser(self::TEST_FILES_SHARING_API_USER1);
+ Filesystem::file_put_contents('/foo.txt', 'bar');
+ $this->assertEtagsNotChanged([self::TEST_FILES_SHARING_API_USER4, self::TEST_FILES_SHARING_API_USER3]);
+ $this->assertEtagsChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2]);
+
+ $this->assertAllUnchaged();
+ }
+
public function testOwnerWritesToShareWithReshare() {
$this->loginAsUser(self::TEST_FILES_SHARING_API_USER1);
Filesystem::file_put_contents('/sub1/sub2/folder/inside/bar.txt', 'bar');