public function testWeeklyTotalTimeSpentPerDate()
 {
     $user = new User();
     $period = new Period(new \DateTime('2014-12-01'), new \DateTime('2015-01-01'));
     $worklogs = new ArrayCollection([new Worklog(new TimeSpent(10), new \DateTime('2014-12-02'), new Task(), $user, 'description'), new Worklog(new TimeSpent(15), new \DateTime('2014-12-03'), new Task(), $user, 'description'), new Worklog(new TimeSpent(20), new \DateTime('2014-12-04'), new Task(), $user, 'description'), new Worklog(new TimeSpent(8), new \DateTime('2014-12-10'), new Task(), $user, 'description'), new Worklog(new TimeSpent(16), new \DateTime('2014-12-12'), new Task(), $user, 'description'), new Worklog(new TimeSpent(24), new \DateTime('2014-12-12'), new Task(), $user, 'description')]);
     $taskList = new TaskList($period, $worklogs, new \DateTimeZone('UTC'));
     $timesheet = new Timesheet($user, $taskList);
     $this->assertEquals(new TimeSpent(45), $timesheet->getWeeklyTotalTimeSpentPerDate(new \DateTime('2014-12-04')));
     $this->assertEquals(new TimeSpent(45), $timesheet->getWeeklyTotalTimeSpentPerDate(new \DateTime('2014-12-07')));
     $this->assertEquals(new TimeSpent(48), $timesheet->getWeeklyTotalTimeSpentPerDate(new \DateTime('2014-12-11')));
 }
 /**
  * @param Timesheet $timesheet
  * @return CalendarPeriod
  */
 private function getCalendarPeriodFromTimesheet(Timesheet $timesheet)
 {
     $calendarService = $this->get('timelap.calendar.service');
     return $calendarService->getCalendarPeriod($timesheet->getPeriod());
 }