diff options
Diffstat (limited to 'tests/units')
-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)); - } } |