summaryrefslogtreecommitdiff
path: root/tests/units/LinkTest.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-05-09 23:00:23 -0400
committerFrederic Guillot <fred@kanboard.net>2015-05-09 23:00:23 -0400
commit4641d4cf77aac54b1c5688a10e78642b8cda2e87 (patch)
treeaefae03b076e4ed437482418171583c15d852c55 /tests/units/LinkTest.php
parent1176a489ab6f3dbe46bc5acea1afca9ecd6de448 (diff)
Improve Link::getOppositeLinkId()
Diffstat (limited to 'tests/units/LinkTest.php')
-rw-r--r--tests/units/LinkTest.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/units/LinkTest.php b/tests/units/LinkTest.php
index ebcbcd39..076e1b3b 100644
--- a/tests/units/LinkTest.php
+++ b/tests/units/LinkTest.php
@@ -36,6 +36,18 @@ class LinkTest extends Base
$this->assertNotEquals($link1['opposite_id'], $link2['opposite_id']);
}
+ public function testGetOppositeLinkId()
+ {
+ $l = new Link($this->container);
+
+ $this->assertTrue($l->create('Link A'));
+ $this->assertTrue($l->create('Link B', 'Link C'));
+
+ $this->assertEquals(1, $l->getOppositeLinkId(1));
+ $this->assertEquals(3, $l->getOppositeLinkId(2));
+ $this->assertEquals(2, $l->getOppositeLinkId(3));
+ }
+
public function testUpdate()
{
$l = new Link($this->container);