diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-09-28 14:26:40 -0400 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-09-28 14:26:40 -0400 |
commit | 03fa01ac7b036820ee232d893ec63241918c6012 (patch) | |
tree | 295e82e6552ffb044554a11afa95318a4e180f87 /tests/units/ActionTaskAssignColorUserTest.php | |
parent | 0c8de6a3f58cde2696ac276b3456f3577d312e2b (diff) |
Improve automatic actions (check for compatible events/actions/parameters)
Diffstat (limited to 'tests/units/ActionTaskAssignColorUserTest.php')
-rw-r--r-- | tests/units/ActionTaskAssignColorUserTest.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/units/ActionTaskAssignColorUserTest.php b/tests/units/ActionTaskAssignColorUserTest.php index ee71e87c..8f6a891e 100644 --- a/tests/units/ActionTaskAssignColorUserTest.php +++ b/tests/units/ActionTaskAssignColorUserTest.php @@ -9,7 +9,7 @@ class ActionTaskAssignColorUser extends Base { public function testBadProject() { - $action = new Action\TaskAssignColorUser(3, new Task($this->registry)); + $action = new Action\TaskAssignColorUser($this->registry, 3, Task::EVENT_CREATE); $event = array( 'project_id' => 2, @@ -23,7 +23,7 @@ class ActionTaskAssignColorUser extends Base public function testExecute() { - $action = new Action\TaskAssignColorUser(1, new Task($this->registry)); + $action = new Action\TaskAssignColorUser($this->registry, 1, Task::EVENT_ASSIGNEE_CHANGE); $action->setParam('user_id', 1); $action->setParam('color_id', 'blue'); @@ -33,11 +33,10 @@ class ActionTaskAssignColorUser extends Base $this->assertEquals(1, $p->create(array('name' => 'test'))); $this->assertEquals(1, $t->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 1, 'color_id' => 'green'))); - // We create an event to move the task to the 2nd column with a user id 5 + // We change the assignee $event = array( 'project_id' => 1, 'task_id' => 1, - 'column_id' => 2, 'owner_id' => 5, ); @@ -50,11 +49,10 @@ class ActionTaskAssignColorUser extends Base $this->assertEquals(0, $task['owner_id']); $this->assertEquals('green', $task['color_id']); - // We create an event to move the task to the 2nd column with a user id 1 + // We change the assignee $event = array( 'project_id' => 1, 'task_id' => 1, - 'column_id' => 2, 'owner_id' => 1, ); |