diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-01-23 12:29:44 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-01-23 12:29:44 -0500 |
commit | ba5937b07490160affad8239a7a9e6227979f770 (patch) | |
tree | c9174bed0db928160e1dd55bf06ac7fbc57acab2 /tests/integration | |
parent | 0448fdc56b9d7c58ac78d8375447c59b68702562 (diff) |
Add new API procedures to move and duplicate tasks to another project
Diffstat (limited to 'tests/integration')
-rw-r--r-- | tests/integration/TaskTest.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/integration/TaskTest.php b/tests/integration/TaskTest.php index 20da12bd..6d500da4 100644 --- a/tests/integration/TaskTest.php +++ b/tests/integration/TaskTest.php @@ -55,4 +55,42 @@ class TaskTest extends Base $task = $this->app->getTask($task_id); $this->assertEquals(0, $task['owner_id']); } + + public function testMoveTaskToAnotherProject() + { + $project_id1 = $this->app->createProject('My project'); + $this->assertNotFalse($project_id1); + + $project_id2 = $this->app->createProject('My project'); + $this->assertNotFalse($project_id2); + + $task_id = $this->app->createTask(array('project_id' => $project_id1, 'title' => 'My task')); + $this->assertNotFalse($task_id); + + $this->assertTrue($this->app->moveTaskToProject($task_id, $project_id2)); + + $task = $this->app->getTask($task_id); + $this->assertEquals($project_id2, $task['project_id']); + } + + public function testMoveCopyToAnotherProject() + { + $project_id1 = $this->app->createProject('My project'); + $this->assertNotFalse($project_id1); + + $project_id2 = $this->app->createProject('My project'); + $this->assertNotFalse($project_id2); + + $task_id1 = $this->app->createTask(array('project_id' => $project_id1, 'title' => 'My task')); + $this->assertNotFalse($task_id1); + + $task_id2 = $this->app->duplicateTaskToProject($task_id1, $project_id2); + $this->assertNotFalse($task_id2); + + $task = $this->app->getTask($task_id1); + $this->assertEquals($project_id1, $task['project_id']); + + $task = $this->app->getTask($task_id2); + $this->assertEquals($project_id2, $task['project_id']); + } } |