summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Schema/Mysql.php3
-rw-r--r--tests/units/Model/TaskExternalLinkTest.php44
2 files changed, 2 insertions, 45 deletions
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php
index 5433c751..036958b6 100644
--- a/app/Schema/Mysql.php
+++ b/app/Schema/Mysql.php
@@ -21,7 +21,8 @@ function version_104(PDO $pdo)
date_modification INT NOT NULL,
task_id INT NOT NULL,
creator_id INT DEFAULT 0,
- FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE
+ FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE,
+ PRIMARY KEY(id)
) ENGINE=InnoDB CHARSET=utf8
");
}
diff --git a/tests/units/Model/TaskExternalLinkTest.php b/tests/units/Model/TaskExternalLinkTest.php
index b3f01759..28ccab83 100644
--- a/tests/units/Model/TaskExternalLinkTest.php
+++ b/tests/units/Model/TaskExternalLinkTest.php
@@ -54,50 +54,6 @@ class TaskExternalLinkTest extends Base
$this->assertEquals(time(), $link['date_creation'], '', 2);
}
- public function testCreateWithNoType()
- {
- $projectModel = new Project($this->container);
- $taskCreationModel = new TaskCreation($this->container);
- $taskExternalLinkModel = new TaskExternalLink($this->container);
-
- $this->assertEquals(1, $projectModel->create(array('name' => 'Test')));
- $this->assertEquals(1, $taskCreationModel->create(array('title' => 'Test', 'project_id' => 1)));
- $this->assertFalse($taskExternalLinkModel->create(array('task_id' => 1, 'id' => '', 'url' => 'http://kanboard.net/', 'title' => 'My website', 'dependency' => 'related')));
- }
-
- public function testCreateWithNoDependency()
- {
- $projectModel = new Project($this->container);
- $taskCreationModel = new TaskCreation($this->container);
- $taskExternalLinkModel = new TaskExternalLink($this->container);
-
- $this->assertEquals(1, $projectModel->create(array('name' => 'Test')));
- $this->assertEquals(1, $taskCreationModel->create(array('title' => 'Test', 'project_id' => 1)));
- $this->assertFalse($taskExternalLinkModel->create(array('task_id' => 1, 'id' => '', 'url' => 'http://kanboard.net/', 'title' => 'My website', 'link_type' => 'test')));
- }
-
- public function testCreateWithNoTitle()
- {
- $projectModel = new Project($this->container);
- $taskCreationModel = new TaskCreation($this->container);
- $taskExternalLinkModel = new TaskExternalLink($this->container);
-
- $this->assertEquals(1, $projectModel->create(array('name' => 'Test')));
- $this->assertEquals(1, $taskCreationModel->create(array('title' => 'Test', 'project_id' => 1)));
- $this->assertFalse($taskExternalLinkModel->create(array('task_id' => 1, 'id' => '', 'url' => 'http://kanboard.net/', 'link_type' => 'test', 'dependency' => 'test')));
- }
-
- public function testCreateWithNoUrl()
- {
- $projectModel = new Project($this->container);
- $taskCreationModel = new TaskCreation($this->container);
- $taskExternalLinkModel = new TaskExternalLink($this->container);
-
- $this->assertEquals(1, $projectModel->create(array('name' => 'Test')));
- $this->assertEquals(1, $taskCreationModel->create(array('title' => 'Test', 'project_id' => 1)));
- $this->assertFalse($taskExternalLinkModel->create(array('task_id' => 1, 'id' => '', 'title' => 'test', 'link_type' => 'test', 'dependency' => 'test')));
- }
-
public function testModification()
{
$projectModel = new Project($this->container);