diff options
author | dalmond <david.almond@f-grp.com> | 2016-08-22 18:37:34 +0100 |
---|---|---|
committer | dalmond <david.almond@f-grp.com> | 2016-08-22 18:45:10 +0100 |
commit | 37425d45a621929bfa209f84f101ac8cd42b0d06 (patch) | |
tree | ddd70a704cdc58c05616af2ec607ab8f8e52ab65 /tests | |
parent | 25bdb03927007a20e6f518987508b39b9588fc97 (diff) |
Unit Test Issues Resolved
Diffstat (limited to 'tests')
-rw-r--r-- | tests/units/Action/TaskAssignColorSwimlaneTest.php | 6 | ||||
-rw-r--r-- | tests/units/Action/TaskAssignPrioritySwimlaneTest.php | 32 |
2 files changed, 11 insertions, 27 deletions
diff --git a/tests/units/Action/TaskAssignColorSwimlaneTest.php b/tests/units/Action/TaskAssignColorSwimlaneTest.php index 898838da..811ffac3 100644 --- a/tests/units/Action/TaskAssignColorSwimlaneTest.php +++ b/tests/units/Action/TaskAssignColorSwimlaneTest.php @@ -28,6 +28,10 @@ class TaskAssignColorSwimlaneTest extends Base ) )); + $task = $taskFinderModel->getById(1); + $this->assertNotEmpty($task); + $this->assertNotEquals('red', $task['color_id']); + $action = new TaskAssignColorSwimlane($this->container); $action->setProjectId(1); $action->setParam('color_id', 'red'); @@ -40,7 +44,7 @@ class TaskAssignColorSwimlaneTest extends Base $this->assertEquals('red', $task['color_id']); } - public function testWithWrongCategory() + public function testWithWrongSwimlane() { $projectModel = new ProjectModel($this->container); $taskCreationModel = new TaskCreationModel($this->container); diff --git a/tests/units/Action/TaskAssignPrioritySwimlaneTest.php b/tests/units/Action/TaskAssignPrioritySwimlaneTest.php index 255d26e3..39c833bf 100644 --- a/tests/units/Action/TaskAssignPrioritySwimlaneTest.php +++ b/tests/units/Action/TaskAssignPrioritySwimlaneTest.php @@ -18,13 +18,17 @@ class TaskAssignPrioritySwimlaneTest extends Base $taskFinderModel = new TaskFinderModel($this->container); $this->assertEquals(1, $projectModel->create(array('name' => 'test1'))); - $this->assertEquals(1, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test'))); + $this->assertEquals(1, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test', 'priority' => 1))); + $task = $taskFinderModel->getById(1); + $this->assertNotEmpty($task); + $this->assertEquals(1, $task['priority']); + $event = new TaskEvent(array( 'task_id' => 1, 'task' => array( 'project_id' => 1, - 'priority' => 1, + 'swimlane_id' => 2, ) )); @@ -39,28 +43,4 @@ class TaskAssignPrioritySwimlaneTest extends Base $this->assertNotEmpty($task); $this->assertEquals(2, $task['priority']); } - - public function testWithWrongCategory() - { - $projectModel = new ProjectModel($this->container); - $taskCreationModel = new TaskCreationModel($this->container); - - $this->assertEquals(1, $projectModel->create(array('name' => 'test1'))); - $this->assertEquals(1, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test'))); - - $event = new TaskEvent(array( - 'task_id' => 1, - 'task' => array( - 'project_id' => 1, - 'swimlane_id' => 3, - ) - )); - - $action = new TaskAssignColorColumn($this->container); - $action->setProjectId(1); - $action->setParam('priority', 2); - $action->setParam('swimlane_id', 2); - - $this->assertFalse($action->execute($event, TaskModel::EVENT_MOVE_SWIMLANE)); - } } |