Added more unit tests for task priority duplication
This commit is contained in:
@@ -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']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user