add some additional assertions to the tests

This commit is contained in:
Bjoern Schiessle 2013-09-25 15:05:23 +02:00
parent 333d3eda99
commit 4077ed6ddb
1 changed files with 11 additions and 2 deletions

View File

@ -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;