diff options
Diffstat (limited to 'tests/units/Formatter')
-rw-r--r-- | tests/units/Formatter/BoardFormatterTest.php | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/tests/units/Formatter/BoardFormatterTest.php b/tests/units/Formatter/BoardFormatterTest.php index 4d469eac..1b0ace1d 100644 --- a/tests/units/Formatter/BoardFormatterTest.php +++ b/tests/units/Formatter/BoardFormatterTest.php @@ -20,24 +20,24 @@ class BoardFormatterTest extends Base $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))); + $this->assertEquals(2, $swimlaneModel->create(1, 'Swimlane 1')); + $this->assertEquals(3, $swimlaneModel->create(1, 'Swimlane 2')); // 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))); + $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' => 1, '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))); + $this->assertEquals(3, $taskCreationModel->create(array('title' => 'Task 3', 'project_id' => 1, 'swimlane_id' => 1, 'column_id' => 1, 'score' => 4))); + $this->assertEquals(4, $taskCreationModel->create(array('title' => 'Task 4', 'project_id' => 1, 'swimlane_id' => 1, '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))); + $this->assertEquals(5, $taskCreationModel->create(array('title' => 'Task 5', 'project_id' => 1, 'swimlane_id' => 1, '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))); + $this->assertEquals(6, $taskCreationModel->create(array('title' => 'Task 6', 'project_id' => 1, 'swimlane_id' => 1, 'column_id' => 3, 'score' => 1))); + $this->assertEquals(7, $taskCreationModel->create(array('title' => 'Task 7', 'project_id' => 1, 'swimlane_id' => 2, 'column_id' => 3, 'score' => 2))); + $this->assertEquals(8, $taskCreationModel->create(array('title' => 'Task 8', 'project_id' => 1, 'swimlane_id' => 3, 'column_id' => 3, 'score' => 3))); $board = BoardFormatter::getInstance($this->container) ->withQuery($taskFinderModel->getExtendedQuery()) @@ -46,7 +46,7 @@ class BoardFormatterTest extends Base $this->assertCount(3, $board); - $this->assertSame(0, $board[0]['id']); + $this->assertSame(1, $board[0]['id']); $this->assertEquals('Default swimlane', $board[0]['name']); $this->assertCount(4, $board[0]['columns']); $this->assertEquals(3, $board[0]['nb_swimlanes']); @@ -85,7 +85,7 @@ class BoardFormatterTest extends Base $this->assertEquals('Task 5', $board[0]['columns'][1]['tasks'][0]['title']); $this->assertEquals('Task 6', $board[0]['columns'][2]['tasks'][0]['title']); - $this->assertSame(1, $board[1]['id']); + $this->assertSame(2, $board[1]['id']); $this->assertEquals('Swimlane 1', $board[1]['name']); $this->assertCount(4, $board[1]['columns']); $this->assertEquals(3, $board[1]['nb_swimlanes']); @@ -134,14 +134,14 @@ class BoardFormatterTest extends Base $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->assertTrue($swimlaneModel->disable(1, 1)); + $this->assertEquals(2, $swimlaneModel->create(1, 'Swimlane 1')); + $this->assertEquals(3, $swimlaneModel->create(1, 'Swimlane 2')); - $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))); + $this->assertEquals(1, $taskCreationModel->create(array('title' => 'Task 1', 'project_id' => 1, 'swimlane_id' => 2, 'column_id' => 1))); + $this->assertEquals(2, $taskCreationModel->create(array('title' => 'Task 2', 'project_id' => 1, 'swimlane_id' => 3, 'column_id' => 2))); + $this->assertEquals(3, $taskCreationModel->create(array('title' => 'Task 3', 'project_id' => 1, 'swimlane_id' => 2, 'column_id' => 2, 'score' => 1))); + $this->assertEquals(4, $taskCreationModel->create(array('title' => 'Task 4', 'project_id' => 1, 'swimlane_id' => 3, 'column_id' => 1))); $board = BoardFormatter::getInstance($this->container) ->withQuery($taskFinderModel->getExtendedQuery()) @@ -208,7 +208,7 @@ class BoardFormatterTest extends Base $swimlaneModel = new SwimlaneModel($this->container); $this->assertEquals(1, $projectModel->create(array('name' => 'Test'))); - $this->assertTrue($swimlaneModel->disableDefault(1)); + $this->assertTrue($swimlaneModel->disable(1, 1)); $board = BoardFormatter::getInstance($this->container) ->withQuery($taskFinderModel->getExtendedQuery()) @@ -245,8 +245,8 @@ class BoardFormatterTest extends Base $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))); + $this->assertEquals(2, $swimlaneModel->create(1, 'Swimlane 1')); + $this->assertEquals(3, $swimlaneModel->create(1, 'Swimlane 2')); $board = BoardFormatter::getInstance($this->container) ->withQuery($taskFinderModel->getExtendedQuery()) |