diff --git a/apps/files_sharing/tests/api.php b/apps/files_sharing/tests/api.php index 02adff7dfaa8b91cbfb9d543f54be4c62ea1ce37..475f203471e3e17354f753010fb5af3df6a1f840 100644 --- a/apps/files_sharing/tests/api.php +++ b/apps/files_sharing/tests/api.php @@ -220,14 +220,23 @@ class Test_Files_Sharing_Api extends \PHPUnit_Framework_TestCase { $fileInfo = $this->view->getFileInfo($this->filename); - \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, + $result = \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, 31); - \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_LINK, + // share was successful? + $this->assertTrue($result); + + $result = \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_LINK, null, 1); + // share was successful? + $this->assertTrue(is_string($result)); + $items = \OCP\Share::getItemShared('file', null); + // make sure that we found a link share and a user share + $this->assertEquals(count($items), 2); + $linkShare = null; $userShare = null;