public function testCreateTimesheet() { $user = new User(); $period = new Period(new \DateTime('2014-12-01'), new \DateTime('2015-01-01')); $worklogs = new ArrayCollection([]); $taskList = new TaskList($period, $worklogs, new \DateTimeZone('UTC')); $timesheet = new Timesheet($user, $taskList); $this->assertEquals($taskList, $timesheet->listTasks()); $this->assertEquals($user, $timesheet->getUser()); $this->assertEquals($period, $timesheet->getPeriod()); }
/** * @param Timesheet $timesheet * @return CalendarPeriod */ private function getCalendarPeriodFromTimesheet(Timesheet $timesheet) { $calendarService = $this->get('timelap.calendar.service'); return $calendarService->getCalendarPeriod($timesheet->getPeriod()); }