summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRafael de Camargo <rafacamargo123@gmail.com>2019-08-28 00:23:48 -0300
committerFrédéric Guillot <fred@kanboard.net>2019-08-27 20:51:27 -0700
commitc0d8407d9a880a8e05063281b129fc84b73017b5 (patch)
tree55da489f26b46ffdd9d0891a3a80f904690ae414 /tests
parentc6df7c081a05139d42d571bbfa74395fcbf3fa4c (diff)
Fix automatic action condition check
Checks for source column instead of current column because the condition is "moved away" Closes #4277
Diffstat (limited to 'tests')
-rw-r--r--tests/units/Action/TaskUpdateStartDateOnMoveColumnTest.php38
1 files changed, 13 insertions, 25 deletions
diff --git a/tests/units/Action/TaskUpdateStartDateOnMoveColumnTest.php b/tests/units/Action/TaskUpdateStartDateOnMoveColumnTest.php
index f95492d6..f2d0a0fc 100644
--- a/tests/units/Action/TaskUpdateStartDateOnMoveColumnTest.php
+++ b/tests/units/Action/TaskUpdateStartDateOnMoveColumnTest.php
@@ -19,17 +19,13 @@ class TaskUpdateStartDateOnMoveColumnTest extends Base
$this->assertEquals(1, $projectModel->create(array('name' => 'test1')));
$this->assertEquals(1, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test', 'column_id' => 1)));
- $this->container['db']->table(TaskModel::TABLE)->eq('id', 1)->update(array('column_id' => 2));
-
- $task = $taskFinderModel->getById(1);
- $this->assertNotEmpty($task);
$event = new TaskEvent(array(
- 'task_id' => $task['id'],
+ 'task_id' => 1,
'task' => array(
- 'project_id' => $task['project_id'],
- 'column_id' => $task['column_id'],
- )
+ 'project_id' => 1,
+ ),
+ 'src_column_id' => 1,
));
$action = new TaskUpdateStartDateOnMoveColumn($this->container);
@@ -49,17 +45,13 @@ class TaskUpdateStartDateOnMoveColumnTest extends Base
$this->assertEquals(1, $projectModel->create(array('name' => 'test1')));
$this->assertEquals(1, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test', 'column_id' => 2)));
- $this->container['db']->table(TaskModel::TABLE)->eq('id', 1)->update(array('column_id' => 1));
-
- $task = $taskFinderModel->getById(1);
- $this->assertNotEmpty($task);
$event = new TaskEvent(array(
- 'task_id' => $task['id'],
+ 'task_id' => 1,
'task' => array(
- 'project_id' => $task['project_id'],
- 'column_id' => $task['column_id'],
- )
+ 'project_id' => 1,
+ ),
+ 'src_column_id' => 2,
));
$action = new TaskUpdateStartDateOnMoveColumn($this->container);
@@ -76,18 +68,14 @@ class TaskUpdateStartDateOnMoveColumnTest extends Base
$this->assertEquals(1, $projectModel->create(array('name' => 'test1')));
$this->assertEquals(1, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test', 'column_id' => 1, 'date_started' => time())));
- $this->container['db']->table(TaskModel::TABLE)->eq('id', 1)->update(array('column_id' => 2));
-
- $task = $taskFinderModel->getById(1);
- $this->assertNotEmpty($task);
$event = new TaskEvent(array(
- 'task_id' => $task['id'],
+ 'task_id' => 1,
'task' => array(
- 'project_id' => $task['project_id'],
- 'column_id' => $task['column_id'],
- 'date_started' => $task['date_started'],
- )
+ 'project_id' => 1,
+ 'date_started' => time(),
+ ),
+ 'src_column_id' => 1,
));
$action = new TaskUpdateStartDateOnMoveColumn($this->container);