]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make sure that testDeleteShare() has some shares to delete
authorBjoern Schiessle <schiessle@owncloud.com>
Mon, 30 Sep 2013 10:23:44 +0000 (12:23 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Mon, 30 Sep 2013 10:23:44 +0000 (12:23 +0200)
1  2 
apps/files_sharing/tests/api.php

index 04640ab726a7d8e92aabf5ae66acaf9080e753ac,f5897a22d8f4595625710802a1a0578433d18224..271484f8d443f75e8f9a5b53ec2417eb31df8c80
@@@ -226,10 -226,9 +226,10 @@@ class Test_Files_Sharing_Api extends \P
                // 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));
++
        }
  
        /**