From 2d890cbc712371f17ba4bbceb02af3c5ba04e6da Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 7 Feb 2015 19:39:39 -0500 Subject: Update task time tracking based on subtask time tracking --- tests/units/TimeTrackingTest.php | 48 ---------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 tests/units/TimeTrackingTest.php (limited to 'tests') diff --git a/tests/units/TimeTrackingTest.php b/tests/units/TimeTrackingTest.php deleted file mode 100644 index 447f1c96..00000000 --- a/tests/units/TimeTrackingTest.php +++ /dev/null @@ -1,48 +0,0 @@ -container); - $tc = new TaskCreation($this->container); - $tf = new TaskFinder($this->container); - $p = new Project($this->container); - $s = new Subtask($this->container); - $ts = new TimeTracking($this->container); - - $this->assertEquals(1, $p->create(array('name' => 'Project #1'))); - $this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1, 'time_estimated' => 4.5))); - $this->assertTrue($tm->update(array('id' => 1, 'time_spent' => 3.5))); - - $task = $tf->getById(1); - $this->assertNotEmpty($task); - $this->assertEquals(4.5, $task['time_estimated']); - $this->assertEquals(3.5, $task['time_spent']); - - $timesheet = $ts->getTaskTimesheet($task, array()); - $this->assertNotEmpty($timesheet); - $this->assertEquals(4.5, $timesheet['time_estimated']); - $this->assertEquals(3.5, $timesheet['time_spent']); - $this->assertEquals(1, $timesheet['time_remaining']); - - // Subtasks calculation - $this->assertEquals(1, $s->create(array('title' => 'subtask #1', 'task_id' => 1, 'time_estimated' => 5.5, 'time_spent' => 3))); - $this->assertEquals(2, $s->create(array('title' => 'subtask #2', 'task_id' => 1, 'time_estimated' => '', 'time_spent' => 4))); - - $timesheet = $ts->getTaskTimesheet($task, $s->getAll(1)); - $this->assertNotEmpty($timesheet); - $this->assertEquals(5.5, $timesheet['time_estimated']); - $this->assertEquals(7, $timesheet['time_spent']); - $this->assertEquals(-1.5, $timesheet['time_remaining']); - } -} -- cgit v1.2.3