diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-05-11 12:25:09 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-05-20 17:56:02 +0200 |
commit | 3cd65fe25dc6f213dd7e4a1687616dc5e0960d4d (patch) | |
tree | 01a4e4a6bb7ff4f3a9243bd6c523fc5a738e1c65 /tests | |
parent | 09b3883d9ceae77793e524209090f2e36ab61260 (diff) | |
download | nextcloud-server-3cd65fe25dc6f213dd7e4a1687616dc5e0960d4d.tar.gz nextcloud-server-3cd65fe25dc6f213dd7e4a1687616dc5e0960d4d.zip |
Add systemtag_group table and get/set methods
Added systemtag to group mapping table.
Added methods in ISystemTagManager to get/set the group mappings.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/SystemTag/SystemTagManagerTest.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/lib/SystemTag/SystemTagManagerTest.php b/tests/lib/SystemTag/SystemTagManagerTest.php index fa13d287ed7..408134a8757 100644 --- a/tests/lib/SystemTag/SystemTagManagerTest.php +++ b/tests/lib/SystemTag/SystemTagManagerTest.php @@ -478,6 +478,23 @@ class SystemTagManagerTest extends TestCase { $this->assertEquals($expectedResult, $this->tagManager->canUserAssignTag($tag1, $user)); } + public function testTagGroups() { + $tag1 = $this->tagManager->createTag('tag1', true, false); + $tag2 = $this->tagManager->createTag('tag2', true, false); + $this->tagManager->setTagGroups($tag1, ['group1', 'group2']); + $this->tagManager->setTagGroups($tag2, ['group2', 'group3']); + + $this->assertEquals(['group1', 'group2'], $this->tagManager->getTagGroups($tag1)); + $this->assertEquals(['group2', 'group3'], $this->tagManager->getTagGroups($tag2)); + + // change groups + $this->tagManager->setTagGroups($tag1, ['group3', 'group4']); + $this->tagManager->setTagGroups($tag2, []); + + $this->assertEquals(['group3', 'group4'], $this->tagManager->getTagGroups($tag1)); + $this->assertEquals([], $this->tagManager->getTagGroups($tag2)); + } + /** * @param ISystemTag $tag1 * @param ISystemTag $tag2 |