summaryrefslogtreecommitdiff
path: root/tests/units/Model
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/Model')
-rw-r--r--tests/units/Model/TaskLinkTest.php49
1 files changed, 0 insertions, 49 deletions
diff --git a/tests/units/Model/TaskLinkTest.php b/tests/units/Model/TaskLinkTest.php
index 4db42d99..192a4298 100644
--- a/tests/units/Model/TaskLinkTest.php
+++ b/tests/units/Model/TaskLinkTest.php
@@ -194,53 +194,4 @@ class TaskLinkTest extends Base
$links = $tl->getAll(2);
$this->assertEmpty($links);
}
-
- public function testValidation()
- {
- $tl = new TaskLink($this->container);
- $p = new Project($this->container);
- $tc = new TaskCreation($this->container);
-
- $this->assertEquals(1, $p->create(array('name' => 'test')));
- $this->assertEquals(1, $tc->create(array('project_id' => 1, 'title' => 'A')));
- $this->assertEquals(2, $tc->create(array('project_id' => 1, 'title' => 'B')));
-
- $links = $tl->getAll(1);
- $this->assertEmpty($links);
-
- $links = $tl->getAll(2);
- $this->assertEmpty($links);
-
- // Check creation
- $r = $tl->validateCreation(array('task_id' => 1, 'link_id' => 1, 'opposite_task_id' => 2));
- $this->assertTrue($r[0]);
-
- $r = $tl->validateCreation(array('task_id' => 1, 'link_id' => 1));
- $this->assertFalse($r[0]);
-
- $r = $tl->validateCreation(array('task_id' => 1, 'opposite_task_id' => 2));
- $this->assertFalse($r[0]);
-
- $r = $tl->validateCreation(array('task_id' => 1, 'opposite_task_id' => 2));
- $this->assertFalse($r[0]);
-
- $r = $tl->validateCreation(array('task_id' => 1, 'link_id' => 1, 'opposite_task_id' => 1));
- $this->assertFalse($r[0]);
-
- // Check modification
- $r = $tl->validateModification(array('id' => 1, 'task_id' => 1, 'link_id' => 1, 'opposite_task_id' => 2));
- $this->assertTrue($r[0]);
-
- $r = $tl->validateModification(array('id' => 1, 'task_id' => 1, 'link_id' => 1));
- $this->assertFalse($r[0]);
-
- $r = $tl->validateModification(array('id' => 1, 'task_id' => 1, 'opposite_task_id' => 2));
- $this->assertFalse($r[0]);
-
- $r = $tl->validateModification(array('id' => 1, 'task_id' => 1, 'opposite_task_id' => 2));
- $this->assertFalse($r[0]);
-
- $r = $tl->validateModification(array('id' => 1, 'task_id' => 1, 'link_id' => 1, 'opposite_task_id' => 1));
- $this->assertFalse($r[0]);
- }
}