[Pkg-owncloud-commits] [owncloud] 110/205: add unit test for single file share etag propagation

David Prévot taffit at moszumanska.debian.org
Thu Jul 2 17:37:01 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit f847d9409e8864d732151b904f826be6c1228dcd
Author: Robin Appelman <icewind at owncloud.com>
Date:   Tue Jun 23 14:31:41 2015 +0200

    add unit test for single file share etag propagation
---
 apps/files_sharing/tests/etagpropagation.php | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/apps/files_sharing/tests/etagpropagation.php b/apps/files_sharing/tests/etagpropagation.php
index 60b7c52..710d712 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');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list