diff options
Diffstat (limited to 'tests/units')
-rw-r--r-- | tests/units/Formatter/BoardFormatterTest.php | 311 | ||||
-rw-r--r-- | tests/units/FunctionTest.php | 21 | ||||
-rw-r--r-- | tests/units/Model/BoardTest.php | 121 |
3 files changed, 332 insertions, 121 deletions
diff --git a/tests/units/Formatter/BoardFormatterTest.php b/tests/units/Formatter/BoardFormatterTest.php new file mode 100644 index 00000000..02b0b518 --- /dev/null +++ b/tests/units/Formatter/BoardFormatterTest.php @@ -0,0 +1,311 @@ +<?php + +use Kanboard\Formatter\BoardFormatter; +use Kanboard\Model\ColumnModel; +use Kanboard\Model\ProjectModel; +use Kanboard\Model\SwimlaneModel; +use Kanboard\Model\TaskCreationModel; +use Kanboard\Model\TaskFinderModel; + +require_once __DIR__.'/../Base.php'; + +class BoardFormatterTest extends Base +{ + public function testFormatWithSwimlanes() + { + $projectModel = new ProjectModel($this->container); + $swimlaneModel = new SwimlaneModel($this->container); + $taskCreationModel = new TaskCreationModel($this->container); + $taskFinderModel = new TaskFinderModel($this->container); + + $this->assertEquals(1, $projectModel->create(array('name' => 'Test'))); + $this->assertEquals(1, $swimlaneModel->create(array('name' => 'Swimlane 1', 'project_id' => 1))); + $this->assertEquals(2, $swimlaneModel->create(array('name' => 'Swimlane 2', 'project_id' => 1))); + + // 2 task within the same column but no score + $this->assertEquals(1, $taskCreationModel->create(array('title' => 'Task 1', 'project_id' => 1, 'swimlane_id' => 0, 'column_id' => 1))); + $this->assertEquals(2, $taskCreationModel->create(array('title' => 'Task 2', 'project_id' => 1, 'swimlane_id' => 0, 'column_id' => 1))); + + // 2 tasks in the same column with score + $this->assertEquals(3, $taskCreationModel->create(array('title' => 'Task 3', 'project_id' => 1, 'swimlane_id' => 0, 'column_id' => 1, 'score' => 4))); + $this->assertEquals(4, $taskCreationModel->create(array('title' => 'Task 4', 'project_id' => 1, 'swimlane_id' => 0, 'column_id' => 1, 'score' => 5))); + + // 1 task in 2nd column + $this->assertEquals(5, $taskCreationModel->create(array('title' => 'Task 5', 'project_id' => 1, 'swimlane_id' => 0, 'column_id' => 2))); + + // tasks in same column but different swimlanes + $this->assertEquals(6, $taskCreationModel->create(array('title' => 'Task 6', 'project_id' => 1, 'swimlane_id' => 0, 'column_id' => 3, 'score' => 1))); + $this->assertEquals(7, $taskCreationModel->create(array('title' => 'Task 7', 'project_id' => 1, 'swimlane_id' => 1, 'column_id' => 3, 'score' => 2))); + $this->assertEquals(8, $taskCreationModel->create(array('title' => 'Task 8', 'project_id' => 1, 'swimlane_id' => 2, 'column_id' => 3, 'score' => 3))); + + $board = BoardFormatter::getInstance($this->container) + ->withQuery($taskFinderModel->getExtendedQuery()) + ->withProjectId(1) + ->format(); + + $this->assertCount(3, $board); + + $this->assertEquals('Default swimlane', $board[0]['name']); + $this->assertCount(4, $board[0]['columns']); + $this->assertEquals(3, $board[0]['nb_swimlanes']); + $this->assertEquals(4, $board[0]['nb_columns']); + $this->assertEquals(6, $board[0]['nb_tasks']); + $this->assertEquals(10, $board[0]['score']); + + $this->assertEquals(4, $board[0]['columns'][0]['column_nb_tasks']); + $this->assertEquals(1, $board[0]['columns'][1]['column_nb_tasks']); + $this->assertEquals(3, $board[0]['columns'][2]['column_nb_tasks']); + $this->assertEquals(0, $board[0]['columns'][3]['column_nb_tasks']); + + $this->assertEquals(9, $board[0]['columns'][0]['column_score']); + $this->assertEquals(0, $board[0]['columns'][1]['column_score']); + $this->assertEquals(6, $board[0]['columns'][2]['column_score']); + $this->assertEquals(0, $board[0]['columns'][3]['column_score']); + + $this->assertSame(9, $board[0]['columns'][0]['score']); + $this->assertSame(0, $board[0]['columns'][1]['score']); + $this->assertSame(1, $board[0]['columns'][2]['score']); + $this->assertSame(0, $board[0]['columns'][3]['score']); + + $this->assertSame(4, $board[0]['columns'][0]['nb_tasks']); + $this->assertSame(1, $board[0]['columns'][1]['nb_tasks']); + $this->assertSame(1, $board[0]['columns'][2]['nb_tasks']); + $this->assertSame(0, $board[0]['columns'][3]['nb_tasks']); + + $this->assertEquals('Task 1', $board[0]['columns'][0]['tasks'][0]['title']); + $this->assertEquals('Task 2', $board[0]['columns'][0]['tasks'][1]['title']); + $this->assertEquals('Task 3', $board[0]['columns'][0]['tasks'][2]['title']); + $this->assertEquals('Task 4', $board[0]['columns'][0]['tasks'][3]['title']); + $this->assertEquals('Task 5', $board[0]['columns'][1]['tasks'][0]['title']); + $this->assertEquals('Task 6', $board[0]['columns'][2]['tasks'][0]['title']); + + $this->assertEquals('Swimlane 1', $board[1]['name']); + $this->assertCount(4, $board[1]['columns']); + $this->assertEquals(3, $board[1]['nb_swimlanes']); + $this->assertEquals(4, $board[1]['nb_columns']); + $this->assertEquals(1, $board[1]['nb_tasks']); + $this->assertEquals(2, $board[1]['score']); + + $this->assertSame(0, $board[1]['columns'][0]['score']); + $this->assertSame(0, $board[1]['columns'][1]['score']); + $this->assertSame(2, $board[1]['columns'][2]['score']); + $this->assertSame(0, $board[1]['columns'][3]['score']); + + $this->assertSame(0, $board[1]['columns'][0]['nb_tasks']); + $this->assertSame(0, $board[1]['columns'][1]['nb_tasks']); + $this->assertSame(1, $board[1]['columns'][2]['nb_tasks']); + $this->assertSame(0, $board[1]['columns'][3]['nb_tasks']); + + $this->assertEquals('Task 7', $board[1]['columns'][2]['tasks'][0]['title']); + + $this->assertEquals('Swimlane 2', $board[2]['name']); + $this->assertCount(4, $board[2]['columns']); + $this->assertEquals(3, $board[2]['nb_swimlanes']); + $this->assertEquals(4, $board[2]['nb_columns']); + $this->assertEquals(1, $board[2]['nb_tasks']); + $this->assertEquals(3, $board[2]['score']); + + $this->assertSame(0, $board[2]['columns'][0]['score']); + $this->assertSame(0, $board[2]['columns'][1]['score']); + $this->assertSame(3, $board[2]['columns'][2]['score']); + $this->assertSame(0, $board[2]['columns'][3]['score']); + + $this->assertSame(0, $board[2]['columns'][0]['nb_tasks']); + $this->assertSame(0, $board[2]['columns'][1]['nb_tasks']); + $this->assertSame(1, $board[2]['columns'][2]['nb_tasks']); + $this->assertSame(0, $board[2]['columns'][3]['nb_tasks']); + + $this->assertEquals('Task 8', $board[2]['columns'][2]['tasks'][0]['title']); + } + + public function testFormatWithoutDefaultSwimlane() + { + $projectModel = new ProjectModel($this->container); + $swimlaneModel = new SwimlaneModel($this->container); + $taskCreationModel = new TaskCreationModel($this->container); + $taskFinderModel = new TaskFinderModel($this->container); + + $this->assertEquals(1, $projectModel->create(array('name' => 'Test'))); + $this->assertTrue($swimlaneModel->disableDefault(1)); + $this->assertEquals(1, $swimlaneModel->create(array('name' => 'Swimlane 1', 'project_id' => 1))); + $this->assertEquals(2, $swimlaneModel->create(array('name' => 'Swimlane 2', 'project_id' => 1))); + + $this->assertEquals(1, $taskCreationModel->create(array('title' => 'Task 1', 'project_id' => 1, 'swimlane_id' => 1, 'column_id' => 1))); + $this->assertEquals(2, $taskCreationModel->create(array('title' => 'Task 2', 'project_id' => 1, 'swimlane_id' => 2, 'column_id' => 2))); + $this->assertEquals(3, $taskCreationModel->create(array('title' => 'Task 3', 'project_id' => 1, 'swimlane_id' => 1, 'column_id' => 2, 'score' => 1))); + $this->assertEquals(4, $taskCreationModel->create(array('title' => 'Task 4', 'project_id' => 1, 'swimlane_id' => 2, 'column_id' => 1))); + + $board = BoardFormatter::getInstance($this->container) + ->withQuery($taskFinderModel->getExtendedQuery()) + ->withProjectId(1) + ->format(); + + $this->assertCount(2, $board); + + $this->assertEquals('Swimlane 1', $board[0]['name']); + $this->assertCount(4, $board[0]['columns']); + $this->assertEquals(2, $board[0]['nb_swimlanes']); + $this->assertEquals(4, $board[0]['nb_columns']); + $this->assertEquals(2, $board[0]['nb_tasks']); + $this->assertEquals(1, $board[0]['score']); + + $this->assertEquals(2, $board[0]['columns'][0]['column_nb_tasks']); + $this->assertEquals(2, $board[0]['columns'][1]['column_nb_tasks']); + $this->assertEquals(0, $board[0]['columns'][2]['column_nb_tasks']); + $this->assertEquals(0, $board[0]['columns'][3]['column_nb_tasks']); + + $this->assertEquals(0, $board[0]['columns'][0]['column_score']); + $this->assertEquals(1, $board[0]['columns'][1]['column_score']); + $this->assertEquals(0, $board[0]['columns'][2]['column_score']); + $this->assertEquals(0, $board[0]['columns'][3]['column_score']); + + $this->assertSame(0, $board[0]['columns'][0]['score']); + $this->assertSame(1, $board[0]['columns'][1]['score']); + $this->assertSame(0, $board[0]['columns'][2]['score']); + $this->assertSame(0, $board[0]['columns'][3]['score']); + + $this->assertSame(1, $board[0]['columns'][0]['nb_tasks']); + $this->assertSame(1, $board[0]['columns'][1]['nb_tasks']); + $this->assertSame(0, $board[0]['columns'][2]['nb_tasks']); + $this->assertSame(0, $board[0]['columns'][3]['nb_tasks']); + + $this->assertEquals('Task 1', $board[0]['columns'][0]['tasks'][0]['title']); + $this->assertEquals('Task 3', $board[0]['columns'][1]['tasks'][0]['title']); + + $this->assertEquals('Swimlane 2', $board[1]['name']); + $this->assertCount(4, $board[1]['columns']); + $this->assertEquals(2, $board[1]['nb_swimlanes']); + $this->assertEquals(4, $board[1]['nb_columns']); + $this->assertEquals(2, $board[1]['nb_tasks']); + $this->assertEquals(0, $board[1]['score']); + + $this->assertSame(0, $board[1]['columns'][0]['score']); + $this->assertSame(0, $board[1]['columns'][1]['score']); + $this->assertSame(0, $board[1]['columns'][2]['score']); + $this->assertSame(0, $board[1]['columns'][3]['score']); + + $this->assertSame(1, $board[1]['columns'][0]['nb_tasks']); + $this->assertSame(1, $board[1]['columns'][1]['nb_tasks']); + $this->assertSame(0, $board[1]['columns'][2]['nb_tasks']); + $this->assertSame(0, $board[1]['columns'][3]['nb_tasks']); + + $this->assertEquals('Task 4', $board[1]['columns'][0]['tasks'][0]['title']); + $this->assertEquals('Task 2', $board[1]['columns'][1]['tasks'][0]['title']); + } + + public function testFormatWithoutSwimlane() + { + $projectModel = new ProjectModel($this->container); + $taskFinderModel = new TaskFinderModel($this->container); + $swimlaneModel = new SwimlaneModel($this->container); + + $this->assertEquals(1, $projectModel->create(array('name' => 'Test'))); + $this->assertTrue($swimlaneModel->disableDefault(1)); + + $board = BoardFormatter::getInstance($this->container) + ->withQuery($taskFinderModel->getExtendedQuery()) + ->withProjectId(1) + ->format(); + + $this->assertCount(0, $board); + } + + public function testFormatWithoutColumn() + { + $projectModel = new ProjectModel($this->container); + $taskFinderModel = new TaskFinderModel($this->container); + $columnModel = new ColumnModel($this->container); + + $this->assertEquals(1, $projectModel->create(array('name' => 'Test'))); + $this->assertTrue($columnModel->remove(1)); + $this->assertTrue($columnModel->remove(2)); + $this->assertTrue($columnModel->remove(3)); + $this->assertTrue($columnModel->remove(4)); + + $board = BoardFormatter::getInstance($this->container) + ->withQuery($taskFinderModel->getExtendedQuery()) + ->withProjectId(1) + ->format(); + + $this->assertCount(0, $board); + } + + public function testFormatWithoutTask() + { + $projectModel = new ProjectModel($this->container); + $swimlaneModel = new SwimlaneModel($this->container); + $taskFinderModel = new TaskFinderModel($this->container); + + $this->assertEquals(1, $projectModel->create(array('name' => 'Test'))); + $this->assertEquals(1, $swimlaneModel->create(array('name' => 'Swimlane 1', 'project_id' => 1))); + $this->assertEquals(2, $swimlaneModel->create(array('name' => 'Swimlane 2', 'project_id' => 1))); + + $board = BoardFormatter::getInstance($this->container) + ->withQuery($taskFinderModel->getExtendedQuery()) + ->withProjectId(1) + ->format(); + + $this->assertCount(3, $board); + + $this->assertEquals('Default swimlane', $board[0]['name']); + $this->assertCount(4, $board[0]['columns']); + $this->assertEquals(3, $board[0]['nb_swimlanes']); + $this->assertEquals(4, $board[0]['nb_columns']); + $this->assertEquals(0, $board[0]['nb_tasks']); + $this->assertEquals(0, $board[0]['score']); + + $this->assertEquals(0, $board[0]['columns'][0]['column_nb_tasks']); + $this->assertEquals(0, $board[0]['columns'][1]['column_nb_tasks']); + $this->assertEquals(0, $board[0]['columns'][2]['column_nb_tasks']); + $this->assertEquals(0, $board[0]['columns'][3]['column_nb_tasks']); + + $this->assertEquals(0, $board[0]['columns'][0]['column_score']); + $this->assertEquals(0, $board[0]['columns'][1]['column_score']); + $this->assertEquals(0, $board[0]['columns'][2]['column_score']); + $this->assertEquals(0, $board[0]['columns'][3]['column_score']); + + $this->assertSame(0, $board[0]['columns'][0]['score']); + $this->assertSame(0, $board[0]['columns'][1]['score']); + $this->assertSame(0, $board[0]['columns'][2]['score']); + $this->assertSame(0, $board[0]['columns'][3]['score']); + + $this->assertSame(0, $board[0]['columns'][0]['nb_tasks']); + $this->assertSame(0, $board[0]['columns'][1]['nb_tasks']); + $this->assertSame(0, $board[0]['columns'][2]['nb_tasks']); + $this->assertSame(0, $board[0]['columns'][3]['nb_tasks']); + + $this->assertEquals('Swimlane 1', $board[1]['name']); + $this->assertCount(4, $board[1]['columns']); + $this->assertEquals(3, $board[1]['nb_swimlanes']); + $this->assertEquals(4, $board[1]['nb_columns']); + $this->assertEquals(0, $board[1]['nb_tasks']); + $this->assertEquals(0, $board[1]['score']); + + $this->assertSame(0, $board[1]['columns'][0]['score']); + $this->assertSame(0, $board[1]['columns'][1]['score']); + $this->assertSame(0, $board[1]['columns'][2]['score']); + $this->assertSame(0, $board[1]['columns'][3]['score']); + + $this->assertSame(0, $board[1]['columns'][0]['nb_tasks']); + $this->assertSame(0, $board[1]['columns'][1]['nb_tasks']); + $this->assertSame(0, $board[1]['columns'][2]['nb_tasks']); + $this->assertSame(0, $board[1]['columns'][3]['nb_tasks']); + + $this->assertEquals('Swimlane 2', $board[2]['name']); + $this->assertCount(4, $board[2]['columns']); + $this->assertEquals(3, $board[2]['nb_swimlanes']); + $this->assertEquals(4, $board[2]['nb_columns']); + $this->assertEquals(0, $board[2]['nb_tasks']); + $this->assertEquals(0, $board[2]['score']); + + $this->assertSame(0, $board[2]['columns'][0]['score']); + $this->assertSame(0, $board[2]['columns'][1]['score']); + $this->assertSame(0, $board[2]['columns'][2]['score']); + $this->assertSame(0, $board[2]['columns'][3]['score']); + + $this->assertSame(0, $board[2]['columns'][0]['nb_tasks']); + $this->assertSame(0, $board[2]['columns'][1]['nb_tasks']); + $this->assertSame(0, $board[2]['columns'][2]['nb_tasks']); + $this->assertSame(0, $board[2]['columns'][3]['nb_tasks']); + } +} diff --git a/tests/units/FunctionTest.php b/tests/units/FunctionTest.php new file mode 100644 index 00000000..72895845 --- /dev/null +++ b/tests/units/FunctionTest.php @@ -0,0 +1,21 @@ +<?php + +require_once __DIR__.'/Base.php'; + +class FunctionTest extends Base +{ + public function testArrayColumnSum() + { + $input = array( + array( + 'my_column' => 123 + ), + array( + 'my_column' => 456.7 + ), + array() + ); + + $this->assertSame(579.7, array_column_sum($input, 'my_column')); + } +} diff --git a/tests/units/Model/BoardTest.php b/tests/units/Model/BoardTest.php index 80587d89..9f540c63 100644 --- a/tests/units/Model/BoardTest.php +++ b/tests/units/Model/BoardTest.php @@ -3,12 +3,8 @@ require_once __DIR__.'/../Base.php'; use Kanboard\Model\ProjectModel; -use Kanboard\Model\BoardModel; use Kanboard\Model\ColumnModel; use Kanboard\Model\ConfigModel; -use Kanboard\Model\TaskCreationModel; -use Kanboard\Model\TaskFinderModel; -use Kanboard\Model\SwimlaneModel; class BoardTest extends Base { @@ -45,121 +41,4 @@ class BoardTest extends Base $this->assertEquals('column #1', $columns[5]); $this->assertEquals('column #2', $columns[6]); } - - public function testGetBoard() - { - $p = new ProjectModel($this->container); - $b = new BoardModel($this->container); - - $this->assertEquals(1, $p->create(array('name' => 'UnitTest1'))); - - $board = $b->getBoard(1); - $this->assertNotEmpty($board); - $this->assertEquals(1, count($board)); - $this->assertEquals(6, count($board[0])); - $this->assertArrayHasKey('name', $board[0]); - $this->assertArrayHasKey('nb_tasks', $board[0]); - $this->assertArrayHasKey('columns', $board[0]); - $this->assertArrayHasKey('tasks', $board[0]['columns'][2]); - $this->assertArrayHasKey('nb_tasks', $board[0]['columns'][2]); - $this->assertArrayHasKey('title', $board[0]['columns'][2]); - $this->assertArrayHasKey('nb_column_tasks', $board[0]['columns'][0]); - $this->assertArrayHasKey('total_score', $board[0]['columns'][0]); - } - - public function testGetBoardWithSwimlane() - { - $b = new BoardModel($this->container); - $tc = new TaskCreationModel($this->container); - $tf = new TaskFinderModel($this->container); - $p = new ProjectModel($this->container); - $s = new SwimlaneModel($this->container); - - $this->assertEquals(1, $p->create(array('name' => 'Project #1'))); - $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'test 1'))); - $this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1, 'column_id' => 1))); - $this->assertEquals(2, $tc->create(array('title' => 'Task #2', 'project_id' => 1, 'column_id' => 3))); - $this->assertEquals(3, $tc->create(array('title' => 'Task #3', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1))); - $this->assertEquals(4, $tc->create(array('title' => 'Task #4', 'project_id' => 1, 'column_id' => 3))); - $this->assertEquals(5, $tc->create(array('title' => 'Task #5', 'project_id' => 1, 'column_id' => 4, 'score' => 2))); - $this->assertEquals(6, $tc->create(array('title' => 'Task #6', 'project_id' => 1, 'column_id' => 4, 'score' => 3, 'swimlane_id' => 1))); - - $board = $b->getBoard(1); - $this->assertNotEmpty($board); - $this->assertEquals(2, count($board)); - $this->assertEquals(6, count($board[0])); - $this->assertArrayHasKey('name', $board[0]); - $this->assertArrayHasKey('nb_tasks', $board[0]); - $this->assertArrayHasKey('columns', $board[0]); - $this->assertArrayHasKey('tasks', $board[0]['columns'][2]); - $this->assertArrayHasKey('nb_tasks', $board[0]['columns'][2]); - $this->assertArrayHasKey('title', $board[0]['columns'][2]); - $this->assertArrayHasKey('nb_column_tasks', $board[0]['columns'][0]); - $this->assertArrayNotHasKey('nb_column_tasks', $board[1]['columns'][0]); - $this->assertArrayNotHasKey('total_score', $board[1]['columns'][0]); - $this->assertArrayHasKey('score', $board[0]['columns'][3]); - $this->assertArrayHasKey('total_score', $board[0]['columns'][3]); - $this->assertEquals(2, $board[0]['columns'][3]['score']); - $this->assertEquals(5, $board[0]['columns'][3]['total_score']); - - $task = $tf->getById(1); - $this->assertEquals(1, $task['id']); - $this->assertEquals(1, $task['column_id']); - $this->assertEquals(1, $task['position']); - $this->assertEquals(0, $task['swimlane_id']); - $this->assertEquals(1, $board[0]['columns'][0]['tasks'][0]['id']); - $this->assertEquals(1, $board[0]['columns'][0]['tasks'][0]['column_id']); - $this->assertEquals(1, $board[0]['columns'][0]['tasks'][0]['position']); - $this->assertEquals(0, $board[0]['columns'][0]['tasks'][0]['swimlane_id']); - - $task = $tf->getById(2); - $this->assertEquals(2, $task['id']); - $this->assertEquals(3, $task['column_id']); - $this->assertEquals(1, $task['position']); - $this->assertEquals(0, $task['swimlane_id']); - $this->assertEquals(2, $board[0]['columns'][2]['tasks'][0]['id']); - $this->assertEquals(3, $board[0]['columns'][2]['tasks'][0]['column_id']); - $this->assertEquals(1, $board[0]['columns'][2]['tasks'][0]['position']); - $this->assertEquals(0, $board[0]['columns'][2]['tasks'][0]['swimlane_id']); - - $task = $tf->getById(3); - $this->assertEquals(3, $task['id']); - $this->assertEquals(2, $task['column_id']); - $this->assertEquals(1, $task['position']); - $this->assertEquals(1, $task['swimlane_id']); - $this->assertEquals(3, $board[1]['columns'][1]['tasks'][0]['id']); - $this->assertEquals(2, $board[1]['columns'][1]['tasks'][0]['column_id']); - $this->assertEquals(1, $board[1]['columns'][1]['tasks'][0]['position']); - $this->assertEquals(1, $board[1]['columns'][1]['tasks'][0]['swimlane_id']); - - $task = $tf->getById(4); - $this->assertEquals(4, $task['id']); - $this->assertEquals(3, $task['column_id']); - $this->assertEquals(2, $task['position']); - $this->assertEquals(0, $task['swimlane_id']); - $this->assertEquals(4, $board[0]['columns'][2]['tasks'][1]['id']); - $this->assertEquals(3, $board[0]['columns'][2]['tasks'][1]['column_id']); - $this->assertEquals(2, $board[0]['columns'][2]['tasks'][1]['position']); - $this->assertEquals(0, $board[0]['columns'][2]['tasks'][1]['swimlane_id']); - - $task = $tf->getById(5); - $this->assertEquals(5, $task['id']); - $this->assertEquals(4, $task['column_id']); - $this->assertEquals(1, $task['position']); - $this->assertEquals(0, $task['swimlane_id']); - $this->assertEquals(5, $board[0]['columns'][3]['tasks'][0]['id']); - $this->assertEquals(4, $board[0]['columns'][3]['tasks'][0]['column_id']); - $this->assertEquals(1, $board[0]['columns'][3]['tasks'][0]['position']); - $this->assertEquals(0, $board[0]['columns'][3]['tasks'][0]['swimlane_id']); - - $task = $tf->getById(6); - $this->assertEquals(6, $task['id']); - $this->assertEquals(4, $task['column_id']); - $this->assertEquals(1, $task['position']); - $this->assertEquals(1, $task['swimlane_id']); - $this->assertEquals(6, $board[1]['columns'][3]['tasks'][0]['id']); - $this->assertEquals(4, $board[1]['columns'][3]['tasks'][0]['column_id']); - $this->assertEquals(1, $board[1]['columns'][3]['tasks'][0]['position']); - $this->assertEquals(1, $board[1]['columns'][3]['tasks'][0]['swimlane_id']); - } } |