From 8d43897e26d0979184978ee731331e051fb086ed Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 12 Aug 2015 22:17:01 -0400 Subject: Fix bug task estimate is reseted when using subtask timer --- tests/units/SubtaskTimeTrackingTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests/units') diff --git a/tests/units/SubtaskTimeTrackingTest.php b/tests/units/SubtaskTimeTrackingTest.php index 27ba7c7d..661812d4 100644 --- a/tests/units/SubtaskTimeTrackingTest.php +++ b/tests/units/SubtaskTimeTrackingTest.php @@ -209,6 +209,9 @@ class SubtaskTimeTrackingTest extends Base $this->assertEquals(1, $s->create(array('title' => 'subtask #1', 'task_id' => 1, 'time_spent' => 2.2))); $this->assertEquals(2, $s->create(array('title' => 'subtask #2', 'task_id' => 1, 'time_estimated' => 1))); + $this->assertEquals(3, $s->create(array('title' => 'subtask #3', 'task_id' => 2, 'time_spent' => 3.4))); + $this->assertEquals(4, $s->create(array('title' => 'subtask #4', 'task_id' => 2, 'time_estimated' => 1.25))); + $st->updateTaskTimeTracking(1); $st->updateTaskTimeTracking(2); @@ -219,8 +222,8 @@ class SubtaskTimeTrackingTest extends Base $task = $tf->getById(2); $this->assertNotEmpty($task); - $this->assertEquals(0.5, $task['time_spent'], 'Total spent', 0.01); - $this->assertEquals(1.5, $task['time_estimated'], 'Total estimated', 0.01); + $this->assertEquals(3.9, $task['time_spent'], 'Total spent', 0.01); + $this->assertEquals(2.75, $task['time_estimated'], 'Total estimated', 0.01); } public function testGetCalendarEvents() -- cgit v1.2.3