diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-08-20 21:26:42 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-08-20 21:26:42 -0400 |
commit | 1484b1c39cac6af68038420b8525620a5424d4ab (patch) | |
tree | 151bac4a4312f439ea17f32dd6d766da7e50a5ab /tests | |
parent | 5b888a23454e369ebf383c3003497038ae2fbf5d (diff) |
Show closed tasks on the Gantt chart and fix rounding for task progress
Diffstat (limited to 'tests')
-rw-r--r-- | tests/units/TaskPositionTest.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/units/TaskPositionTest.php b/tests/units/TaskPositionTest.php index f3be325b..83436683 100644 --- a/tests/units/TaskPositionTest.php +++ b/tests/units/TaskPositionTest.php @@ -3,6 +3,8 @@ require_once __DIR__.'/Base.php'; use Model\Task; +use Model\Board; +use Model\TaskStatus; use Model\TaskPosition; use Model\TaskCreation; use Model\TaskFinder; @@ -11,6 +13,33 @@ use Model\Swimlane; class TaskPositionTest extends Base { + public function testGetTaskProgression() + { + $t = new Task($this->container); + $ts = new TaskStatus($this->container); + $tp = new TaskPosition($this->container); + $tc = new TaskCreation($this->container); + $tf = new TaskFinder($this->container); + $p = new Project($this->container); + $b = new Board($this->container); + + $this->assertEquals(1, $p->create(array('name' => 'Project #1'))); + $this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1, 'column_id' => 1))); + $this->assertEquals(0, $t->getProgress($tf->getById(1), $b->getColumnsList(1))); + + $this->assertTrue($tp->movePosition(1, 1, 2, 1)); + $this->assertEquals(25, $t->getProgress($tf->getById(1), $b->getColumnsList(1))); + + $this->assertTrue($tp->movePosition(1, 1, 3, 1)); + $this->assertEquals(50, $t->getProgress($tf->getById(1), $b->getColumnsList(1))); + + $this->assertTrue($tp->movePosition(1, 1, 4, 1)); + $this->assertEquals(75, $t->getProgress($tf->getById(1), $b->getColumnsList(1))); + + $this->assertTrue($ts->close(1)); + $this->assertEquals(100, $t->getProgress($tf->getById(1), $b->getColumnsList(1))); + } + public function testMoveTaskToWrongPosition() { $tp = new TaskPosition($this->container); |