diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-04-29 21:40:45 +0300 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-07-06 15:12:12 +0300 |
commit | e20db42a0c51fd7f7d028852ef60d47dd71e4adc (patch) | |
tree | ed38b52234e8f9e1cd3840997ff39c151db87992 /tests | |
parent | 08bfd634068cd11166abb82bbb1c0da235da6cec (diff) |
Tags.php and the old sharing mechanism
The old sharing mechanism isn't working anymore, because it was replaced by Share 2.0. Also it was nowhere used so this removes the code paths and reduces complexity.
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/TagsTest.php | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/tests/lib/TagsTest.php b/tests/lib/TagsTest.php index 38d3d611bb8..69c2833433d 100644 --- a/tests/lib/TagsTest.php +++ b/tests/lib/TagsTest.php @@ -24,7 +24,6 @@ namespace Test; use OCP\IUser; use OCP\IUserSession; -use OCP\Share\IShare; /** * Class TagsTest @@ -287,39 +286,4 @@ class TagsTest extends \Test\TestCase { $this->assertTrue($tagger->removeFromFavorites(1)); $this->assertEquals([], $tagger->getFavorites()); } - - public function testShareTags() { - $testTag = 'TestTag'; - \OC\Share\Share::registerBackend('test', 'Test\Share\Backend'); - - $tagger = $this->tagMgr->load('test'); - $tagger->tagAs(1, $testTag); - - - $otherUserId = $this->getUniqueID('user2_'); - $otherUser = $this->createMock(IUser::class); - $otherUser->method('getUID') - ->willReturn($otherUserId); - - \OC::$server->getUserManager()->createUser($otherUserId, 'pass'); - \OC_User::setUserId($otherUserId); - $otherUserSession = $this->createMock(IUserSession::class); - $otherUserSession - ->expects($this->any()) - ->method('getUser') - ->willReturn($otherUser); - - $otherTagMgr = new \OC\TagManager($this->tagMapper, $otherUserSession); - $otherTagger = $otherTagMgr->load('test'); - $this->assertFalse($otherTagger->hasTag($testTag)); - - \OC_User::setUserId($this->user->getUID()); - // TODO new sharing - \OC\Share\Share::shareItem('test', 1, IShare::TYPE_USER, $otherUserId, \OCP\Constants::PERMISSION_READ); - - \OC_User::setUserId($otherUserId); - $otherTagger = $otherTagMgr->load('test', [], true); // Update tags, load shared ones. - $this->assertTrue($otherTagger->hasTag($testTag)); - $this->assertContains(1, $otherTagger->getIdsForTag($testTag)); - } } |