Unit Test Issues Resolved

This commit is contained in:
dalmond 2016-08-22 18:37:34 +01:00
parent 25bdb03927
commit 37425d45a6
2 changed files with 11 additions and 27 deletions

View File

@ -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);

View File

@ -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));
}
}