Added more unit tests for task priority duplication
This commit is contained in:
@@ -3,6 +3,7 @@ Version 1.0.31 (unreleased)
|
|||||||
|
|
||||||
New features:
|
New features:
|
||||||
|
|
||||||
|
* Added tags: global and specific by project
|
||||||
* Added application and project roles validation for API procedure calls
|
* Added application and project roles validation for API procedure calls
|
||||||
* Added new API call: "getProjectByIdentifier"
|
* Added new API call: "getProjectByIdentifier"
|
||||||
* Added new API calls for external task links, project attachments and subtask time tracking
|
* Added new API calls for external task links, project attachments and subtask time tracking
|
||||||
@@ -19,6 +20,7 @@ Improvements:
|
|||||||
* Use the same task form layout everywhere
|
* Use the same task form layout everywhere
|
||||||
* Removed some tasks dropdown menus that are now available with task edit form
|
* Removed some tasks dropdown menus that are now available with task edit form
|
||||||
* Make embedded documentation readable in multiple languages (if a translation is available)
|
* Make embedded documentation readable in multiple languages (if a translation is available)
|
||||||
|
* Added acceptance tests (browser tests)
|
||||||
|
|
||||||
Bug fixes:
|
Bug fixes:
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ class TaskProjectMoveModel extends TaskDuplicationModel
|
|||||||
$values['swimlane_id'] = $swimlane_id !== null ? $swimlane_id : $task['swimlane_id'];
|
$values['swimlane_id'] = $swimlane_id !== null ? $swimlane_id : $task['swimlane_id'];
|
||||||
$values['category_id'] = $category_id !== null ? $category_id : $task['category_id'];
|
$values['category_id'] = $category_id !== null ? $category_id : $task['category_id'];
|
||||||
$values['owner_id'] = $owner_id !== null ? $owner_id : $task['owner_id'];
|
$values['owner_id'] = $owner_id !== null ? $owner_id : $task['owner_id'];
|
||||||
|
$values['priority'] = $task['priority'];
|
||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ class TaskDuplicationModelTest extends Base
|
|||||||
$this->assertEquals(0, $task['time_spent']);
|
$this->assertEquals(0, $task['time_spent']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDuplicateSameProjectWitTags()
|
public function testDuplicateSameProjectWithTags()
|
||||||
{
|
{
|
||||||
$taskDuplicationModel = new TaskDuplicationModel($this->container);
|
$taskDuplicationModel = new TaskDuplicationModel($this->container);
|
||||||
$taskCreationModel = new TaskCreationModel($this->container);
|
$taskCreationModel = new TaskCreationModel($this->container);
|
||||||
@@ -118,4 +118,25 @@ class TaskDuplicationModelTest extends Base
|
|||||||
$this->assertArrayHasKey(1, $tags);
|
$this->assertArrayHasKey(1, $tags);
|
||||||
$this->assertArrayHasKey(2, $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']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,14 @@ class TaskProjectDuplicationModelTest extends Base
|
|||||||
$this->assertNotFalse($categoryModel->create(array('name' => 'Category #1', 'project_id' => 1)));
|
$this->assertNotFalse($categoryModel->create(array('name' => 'Category #1', 'project_id' => 1)));
|
||||||
$this->assertTrue($categoryModel->exists(1));
|
$this->assertTrue($categoryModel->exists(1));
|
||||||
|
|
||||||
$this->assertEquals(1, $taskCreationModel->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2, 'owner_id' => 1, 'category_id' => 1)));
|
$this->assertEquals(1, $taskCreationModel->create(array(
|
||||||
|
'title' => 'test',
|
||||||
|
'project_id' => 1,
|
||||||
|
'column_id' => 2,
|
||||||
|
'owner_id' => 1,
|
||||||
|
'category_id' => 1,
|
||||||
|
'priority' => 3,
|
||||||
|
)));
|
||||||
|
|
||||||
$this->container['dispatcher']->addListener(TaskModel::EVENT_CREATE_UPDATE, function () {});
|
$this->container['dispatcher']->addListener(TaskModel::EVENT_CREATE_UPDATE, function () {});
|
||||||
$this->container['dispatcher']->addListener(TaskModel::EVENT_CREATE, function () {});
|
$this->container['dispatcher']->addListener(TaskModel::EVENT_CREATE, function () {});
|
||||||
@@ -52,6 +59,7 @@ class TaskProjectDuplicationModelTest extends Base
|
|||||||
$this->assertEquals(6, $task['column_id']);
|
$this->assertEquals(6, $task['column_id']);
|
||||||
$this->assertEquals(1, $task['position']);
|
$this->assertEquals(1, $task['position']);
|
||||||
$this->assertEquals(2, $task['project_id']);
|
$this->assertEquals(2, $task['project_id']);
|
||||||
|
$this->assertEquals(3, $task['priority']);
|
||||||
$this->assertEquals('test', $task['title']);
|
$this->assertEquals('test', $task['title']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,14 @@ class TaskProjectMoveModelTest extends Base
|
|||||||
$this->assertEquals(2, $projectModel->create(array('name' => 'test2')));
|
$this->assertEquals(2, $projectModel->create(array('name' => 'test2')));
|
||||||
|
|
||||||
// We create a task
|
// We create a task
|
||||||
$this->assertEquals(1, $taskCreationModel->create(array('title' => 'test', 'project_id' => 1, 'owner_id' => 1, 'category_id' => 10, 'position' => 333)));
|
$this->assertEquals(1, $taskCreationModel->create(array(
|
||||||
|
'title' => 'test',
|
||||||
|
'project_id' => 1,
|
||||||
|
'owner_id' => 1,
|
||||||
|
'category_id' => 10,
|
||||||
|
'position' => 333,
|
||||||
|
'priority' => 1,
|
||||||
|
)));
|
||||||
|
|
||||||
$this->container['dispatcher']->addListener(TaskModel::EVENT_MOVE_PROJECT, array($this, 'onMoveProject'));
|
$this->container['dispatcher']->addListener(TaskModel::EVENT_MOVE_PROJECT, array($this, 'onMoveProject'));
|
||||||
|
|
||||||
@@ -58,6 +65,7 @@ class TaskProjectMoveModelTest extends Base
|
|||||||
$this->assertEquals(2, $task['project_id']);
|
$this->assertEquals(2, $task['project_id']);
|
||||||
$this->assertEquals(5, $task['column_id']);
|
$this->assertEquals(5, $task['column_id']);
|
||||||
$this->assertEquals(1, $task['position']);
|
$this->assertEquals(1, $task['position']);
|
||||||
|
$this->assertEquals(1, $task['priority']);
|
||||||
$this->assertEquals('test', $task['title']);
|
$this->assertEquals('test', $task['title']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user