Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-05-11 13:25:09 +0300
committerVincent Petry <pvince81@owncloud.com>2016-05-20 18:56:02 +0300
commit3cd65fe25dc6f213dd7e4a1687616dc5e0960d4d (patch)
tree01a4e4a6bb7ff4f3a9243bd6c523fc5a738e1c65 /tests/lib/SystemTag
parent09b3883d9ceae77793e524209090f2e36ab61260 (diff)
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/lib/SystemTag')
-rw-r--r--tests/lib/SystemTag/SystemTagManagerTest.php17
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