diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-11-10 11:06:48 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-11-10 11:06:48 +0100 |
commit | 20cad09f7fa7f81862fbfb538bed7ddd8c0923b3 (patch) | |
tree | ecd8c38ee9a62974baa94a0b704ccf07776b6654 /apps | |
parent | 331ef0e3c0a1417f70bf9eb417ec078412d04c5c (diff) | |
download | nextcloud-server-20cad09f7fa7f81862fbfb538bed7ddd8c0923b3.tar.gz nextcloud-server-20cad09f7fa7f81862fbfb538bed7ddd8c0923b3.zip |
Add tests for FileInfo owner
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/tests/share.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/files_sharing/tests/share.php b/apps/files_sharing/tests/share.php index abff820c168..896191dfe51 100644 --- a/apps/files_sharing/tests/share.php +++ b/apps/files_sharing/tests/share.php @@ -322,6 +322,22 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase { ); } + public function testFileOwner() { + + $fileinfo = $this->view->getFileInfo($this->filename); + + $result = \OCP\Share::shareItem('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER, + \Test_Files_Sharing::TEST_FILES_SHARING_API_USER2, \OCP\Constants::PERMISSION_ALL); + + $this->assertTrue($result); + + $this->loginHelper(\Test_Files_Sharing::TEST_FILES_SHARING_API_USER2); + + $info = \OC\Files\Filesystem::getFileInfo($this->filename); + + $this->assertSame(\Test_Files_Sharing::TEST_FILES_SHARING_API_USER1, $info->getOwner()->getUID()); + } + /** * @dataProvider dataProviderGetUsersSharingFile * |