// share was successful?
$this->assertTrue($result);
+ // get item to determine share ID
$result = \OCP\Share::getItemShared('file', $fileInfo['fileid']);
- $this->assertEquals(count($result), 1);
+ $this->assertEquals(1, count($result));
// get first element
$share = reset($result);
* @depends testCreateShare
*/
function testDeleteShare() {
++
++ $fileInfo = $this->view->getFileInfo($this->filename);
++
++ \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,
++ null, 1);
++
$items = \OCP\Share::getItemShared('file', null);
++ $this->assertEquals(2, count($items));
++
foreach ($items as $item) {
$result = Share\Api::deleteShare(array('id' => $item['id']));
$itemsAfterDelete = \OCP\Share::getItemShared('file', null);
$this->assertTrue(empty($itemsAfterDelete));
++
}
/**