summaryrefslogtreecommitdiff
path: root/tests/functionals
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-06-16 20:04:07 -0400
committerFrederic Guillot <fred@kanboard.net>2015-06-16 20:04:07 -0400
commit79de1a0cea67d3f6348fa47825edc6fe84a1c454 (patch)
tree2c03de0f3aa5fb3bff7b51a75295deb08f02f687 /tests/functionals
parente7ccaaeee4180bbf3a9ac23a5423c28185875bac (diff)
API: Change parameters for updateTask, enforce the use of moveTaskPosition() to move a task
Diffstat (limited to 'tests/functionals')
-rw-r--r--tests/functionals/ApiTest.php42
1 files changed, 36 insertions, 6 deletions
diff --git a/tests/functionals/ApiTest.php b/tests/functionals/ApiTest.php
index 92c752bb..642288b8 100644
--- a/tests/functionals/ApiTest.php
+++ b/tests/functionals/ApiTest.php
@@ -348,11 +348,6 @@ class Api extends PHPUnit_Framework_TestCase
$this->assertEquals('Swimlane A', $swimlanes[2]['name']);
}
- public function testRemoveSwimlane()
- {
- $this->assertTrue($this->client->removeSwimlane(1, 2));
- }
-
public function testCreateTask()
{
$task = array(
@@ -408,6 +403,42 @@ class Api extends PHPUnit_Framework_TestCase
$this->assertEmpty($tasks);
}
+ public function testMoveTaskSwimlane()
+ {
+ $task_id = $this->getTaskId();
+
+ $task = $this->client->getTask($task_id);
+ $this->assertNotFalse($task);
+ $this->assertTrue(is_array($task));
+ $this->assertEquals(1, $task['position']);
+ $this->assertEquals(2, $task['column_id']);
+ $this->assertEquals(0, $task['swimlane_id']);
+
+ $moved_timestamp = $task['date_moved'];
+ sleep(1);
+ $this->assertTrue($this->client->moveTaskPosition(1, $task_id, 4, 1, 2));
+
+ $task = $this->client->getTask($task_id);
+ $this->assertNotFalse($task);
+ $this->assertTrue(is_array($task));
+ $this->assertEquals(1, $task['position']);
+ $this->assertEquals(4, $task['column_id']);
+ $this->assertEquals(2, $task['swimlane_id']);
+ $this->assertNotEquals($moved_timestamp, $task['date_moved']);
+ }
+
+ public function testRemoveSwimlane()
+ {
+ $this->assertTrue($this->client->removeSwimlane(1, 2));
+
+ $task = $this->client->getTask($this->getTaskId());
+ $this->assertNotFalse($task);
+ $this->assertTrue(is_array($task));
+ $this->assertEquals(1, $task['position']);
+ $this->assertEquals(4, $task['column_id']);
+ $this->assertEquals(0, $task['swimlane_id']);
+ }
+
public function testUpdateTask()
{
$task = $this->client->getTask(1);
@@ -415,7 +446,6 @@ class Api extends PHPUnit_Framework_TestCase
$values = array();
$values['id'] = $task['id'];
$values['color_id'] = 'green';
- $values['column_id'] = 1;
$values['description'] = 'test';
$values['date_due'] = '';