From 4077ed6ddbd11a4013284ea1a15455a68827f16d Mon Sep 17 00:00:00 2001
From: Bjoern Schiessle <schiessle@owncloud.com>
Date: Wed, 25 Sep 2013 15:05:23 +0200
Subject: [PATCH] add some additional assertions to the tests

---
 apps/files_sharing/tests/api.php | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/apps/files_sharing/tests/api.php b/apps/files_sharing/tests/api.php
index 02adff7dfaa..475f203471e 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;
 
-- 
GitLab