summaryrefslogtreecommitdiff
path: root/tests/units
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units')
-rw-r--r--tests/units/Model/GroupModelTest.php (renamed from tests/units/Model/GroupTest.php)11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/units/Model/GroupTest.php b/tests/units/Model/GroupModelTest.php
index 85c2c5d9..4ad0a167 100644
--- a/tests/units/Model/GroupTest.php
+++ b/tests/units/Model/GroupModelTest.php
@@ -4,7 +4,7 @@ require_once __DIR__.'/../Base.php';
use Kanboard\Model\GroupModel;
-class GroupTest extends Base
+class GroupModelTest extends Base
{
public function testCreation()
{
@@ -57,4 +57,13 @@ class GroupTest extends Base
$this->assertTrue($groupModel->remove(1));
$this->assertEmpty($groupModel->getById(1));
}
+
+ public function testGetOrCreateExternalGroupId()
+ {
+ $groupModel = new GroupModel($this->container);
+ $this->assertEquals(1, $groupModel->create('Group 1', 'ExternalId1'));
+ $this->assertEquals(1, $groupModel->getOrCreateExternalGroupId('Group 1', 'ExternalId1'));
+ $this->assertEquals(1, $groupModel->getOrCreateExternalGroupId('Group 2', 'ExternalId1'));
+ $this->assertEquals(2, $groupModel->getOrCreateExternalGroupId('Group 2', 'ExternalId2'));
+ }
}