summaryrefslogtreecommitdiff
path: root/tests/units/Model/TaskDuplicationModelTest.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-07-03 10:45:34 -0400
committerFrederic Guillot <fred@kanboard.net>2016-07-03 10:45:34 -0400
commitd975a3ac45df8515a86ab656d1a48d85c9f83c27 (patch)
tree69b5dcaca9895d7cc2dcce4ba50b1ee8aca2b38b /tests/units/Model/TaskDuplicationModelTest.php
parent9eb43dd3fce9217bbb0563850e084655a041ca4e (diff)
Added more unit tests for task priority duplication
Diffstat (limited to 'tests/units/Model/TaskDuplicationModelTest.php')
-rw-r--r--tests/units/Model/TaskDuplicationModelTest.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/units/Model/TaskDuplicationModelTest.php b/tests/units/Model/TaskDuplicationModelTest.php
index f5b8c540..1c42b6a1 100644
--- a/tests/units/Model/TaskDuplicationModelTest.php
+++ b/tests/units/Model/TaskDuplicationModelTest.php
@@ -97,7 +97,7 @@ class TaskDuplicationModelTest extends Base
$this->assertEquals(0, $task['time_spent']);
}
- public function testDuplicateSameProjectWitTags()
+ public function testDuplicateSameProjectWithTags()
{
$taskDuplicationModel = new TaskDuplicationModel($this->container);
$taskCreationModel = new TaskCreationModel($this->container);
@@ -118,4 +118,25 @@ class TaskDuplicationModelTest extends Base
$this->assertArrayHasKey(1, $tags);
$this->assertArrayHasKey(2, $tags);
}
+
+ public function testDuplicateSameProjectWithPriority()
+ {
+ $taskDuplicationModel = new TaskDuplicationModel($this->container);
+ $taskCreationModel = new TaskCreationModel($this->container);
+ $projectModel = new ProjectModel($this->container);
+ $taskFinderModel = new TaskFinderModel($this->container);
+
+ $this->assertEquals(1, $projectModel->create(array('name' => 'test1')));
+ $this->assertEquals(1, $taskCreationModel->create(array(
+ 'title' => 'test',
+ 'project_id' => 1,
+ 'priority' => 2
+ )));
+
+ $this->assertEquals(2, $taskDuplicationModel->duplicate(1));
+
+ $task = $taskFinderModel->getById(2);
+ $this->assertNotEmpty($task);
+ $this->assertEquals(2, $task['priority']);
+ }
}