diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-08-15 14:29:26 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-08-15 14:29:26 +0200 |
commit | a55e794bfdafc3719b0053709dbefd506692fa1b (patch) | |
tree | 5cfaf37da18707b4f6e8b9ea0a30575d1848cb74 /tests/lib/Share | |
parent | cf7c4a4439da66055db5b43f9d6bc6e4671aa3e4 (diff) | |
download | nextcloud-server-a55e794bfdafc3719b0053709dbefd506692fa1b.tar.gz nextcloud-server-a55e794bfdafc3719b0053709dbefd506692fa1b.zip |
Cleanup unused methods
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests/lib/Share')
-rw-r--r-- | tests/lib/Share/Backend.php | 2 | ||||
-rw-r--r-- | tests/lib/Share/ShareTest.php | 26 |
2 files changed, 14 insertions, 14 deletions
diff --git a/tests/lib/Share/Backend.php b/tests/lib/Share/Backend.php index c5007d1583b..13a86bfae30 100644 --- a/tests/lib/Share/Backend.php +++ b/tests/lib/Share/Backend.php @@ -47,7 +47,7 @@ class Backend implements \OCP\Share_Backend { } - $shares = \OCP\Share::getItemsSharedWithUser('test', $shareWith); + $shares = \OC\Share\Share::getItemsSharedWithUser('test', $shareWith); $knownTargets = array(); foreach ($shares as $share) { diff --git a/tests/lib/Share/ShareTest.php b/tests/lib/Share/ShareTest.php index 4f929446da0..e93b0f553cd 100644 --- a/tests/lib/Share/ShareTest.php +++ b/tests/lib/Share/ShareTest.php @@ -164,10 +164,10 @@ class ShareTest extends \Test\TestCase { $result = \OCP\Share::getItemShared('folder', $fileId, Backend::FORMAT_SOURCE); $this->assertNotEmpty($result); - $result = \OCP\Share::getItemSharedWithUser('folder', $fileId, $this->user2->getUID()); + $result = \OC\Share\Share::getItemSharedWithUser('folder', $fileId, $this->user2->getUID()); $this->assertNotEmpty($result); - $result = \OCP\Share::getItemsSharedWithUser('folder', $this->user2->getUID()); + $result = \OC\Share\Share::getItemsSharedWithUser('folder', $this->user2->getUID()); $this->assertNotEmpty($result); // move to trash (keeps file id) @@ -176,10 +176,10 @@ class ShareTest extends \Test\TestCase { $result = \OCP\Share::getItemShared('folder', $fileId, Backend::FORMAT_SOURCE); $this->assertEmpty($result, 'Share must not be returned for files outside of "files"'); - $result = \OCP\Share::getItemSharedWithUser('folder', $fileId, $this->user2->getUID()); + $result = \OC\Share\Share::getItemSharedWithUser('folder', $fileId, $this->user2->getUID()); $this->assertEmpty($result, 'Share must not be returned for files outside of "files"'); - $result = \OCP\Share::getItemsSharedWithUser('folder', $this->user2->getUID()); + $result = \OC\Share\Share::getItemsSharedWithUser('folder', $this->user2->getUID()); $this->assertEmpty($result, 'Share must not be returned for files outside of "files"'); } @@ -242,7 +242,7 @@ class ShareTest extends \Test\TestCase { 'Failed asserting that user 1 successfully shared "test/sub1/file.txt" with user 2.' ); - $result = \OCP\Share::getItemsSharedWithUser('file', $this->user2->getUID()); + $result = \OC\Share\Share::getItemsSharedWithUser('file', $this->user2->getUID()); $this->assertCount(2, $result); foreach ($result as $share) { @@ -270,7 +270,7 @@ class ShareTest extends \Test\TestCase { foreach($targetUsers as $targetUser) { \OC_User::setUserId($targetUser); - $items = \OCP\Share::getItemsSharedWithUser( + $items = \OC\Share\Share::getItemsSharedWithUser( 'test', $targetUser, Backend::FORMAT_TARGET @@ -279,7 +279,7 @@ class ShareTest extends \Test\TestCase { } \OC_User::setUserId($this->user5->getUID()); - \OCP\Share::unshare( + \OC\Share\Share::unshare( 'test', 'test.txt', \OCP\Share::SHARE_TYPE_GROUP, @@ -289,7 +289,7 @@ class ShareTest extends \Test\TestCase { // verify that all were deleted foreach($targetUsers as $targetUser) { \OC_User::setUserId($targetUser); - $items = \OCP\Share::getItemsSharedWithUser( + $items = \OC\Share\Share::getItemsSharedWithUser( 'test', $targetUser, Backend::FORMAT_TARGET @@ -403,7 +403,7 @@ class ShareTest extends \Test\TestCase { public function testGetShareSubItemsWhenUserNotInGroup() { \OC\Share\Share::shareItem('test', 'test.txt', \OCP\Share::SHARE_TYPE_GROUP, $this->group1->getGID(), \OCP\Constants::PERMISSION_READ); - $result = \OCP\Share::getItemsSharedWithUser('test', $this->user2->getUID()); + $result = \OC\Share\Share::getItemsSharedWithUser('test', $this->user2->getUID()); $this->assertCount(1, $result); $groupShareId = array_keys($result)[0]; @@ -412,7 +412,7 @@ class ShareTest extends \Test\TestCase { $userObject = \OC::$server->getUserManager()->get($this->user2->getUID()); \OC::$server->getGroupManager()->get($this->group1->getGID())->removeUser($userObject); - $result = \OCP\Share::getItemsSharedWithUser('test', $this->user2->getUID()); + $result = \OC\Share\Share::getItemsSharedWithUser('test', $this->user2->getUID()); $this->assertCount(0, $result); // test with buggy data @@ -431,7 +431,7 @@ class ShareTest extends \Test\TestCase { 'stime' => $qb->expr()->literal(time()), ])->execute(); - $result = \OCP\Share::getItemsSharedWithUser('test', $this->user2->getUID()); + $result = \OC\Share\Share::getItemsSharedWithUser('test', $this->user2->getUID()); $this->assertCount(0, $result); $qb->delete('share')->execute(); @@ -585,7 +585,7 @@ class ShareTest extends \Test\TestCase { ->with($this->stringStartsWith('http://' . $urlHost . '/ocs/v2.php/cloud/shares/' . $share['id'] . '/unshare'), $this->anything()) ->willReturn(['success' => true, 'result' => json_encode(['ocs' => ['meta' => ['statuscode' => 100]]])]); - \OCP\Share::unshare('test', 'test.txt', \OCP\Share::SHARE_TYPE_REMOTE, $shareWith); + \OC\Share\Share::unshare('test', 'test.txt', \OCP\Share::SHARE_TYPE_REMOTE, $shareWith); $this->restoreService('HTTPHelper'); } @@ -697,7 +697,7 @@ class ShareTest extends \Test\TestCase { ->with($this->stringStartsWith('https://localhost/ocs/v2.php/cloud/shares/' . $share['id'] . '/unshare'), $this->anything()) ->willReturn(['success' => true, 'result' => json_encode(['ocs' => ['meta' => ['statuscode' => 100]]])]); - \OCP\Share::unshare('test', 'test.txt', \OCP\Share::SHARE_TYPE_REMOTE, 'foo@localhost'); + \OC\Share\Share::unshare('test', 'test.txt', \OCP\Share::SHARE_TYPE_REMOTE, 'foo@localhost'); $this->restoreService('HTTPHelper'); } |