/** * @param \DateTime $date * @param TimeSpent $timeSpent * @return void */ public function addTimeSpent(\DateTime $date, TimeSpent $timeSpent) { if (!array_key_exists($date->format(self::DATE_FORMAT), $this->timeSpentPerDateList)) { $this->timeSpentPerDateList[$date->format(self::DATE_FORMAT)] = 0; } $this->timeSpentPerDateList[$date->format(self::DATE_FORMAT)] += $timeSpent->getValue(); }
public function testThatCreates() { $timeSpent = new TimeSpent(123); $this->assertEquals(123, $timeSpent->getValue()); }