/** * @param array $data */ public function populateFromArray(array $data) { if (empty($data['event_uid'])) { throw new InvalidArgumentException('Invalid event_uid'); } $this->uid = $data['event_uid']; $this->calendarId = $data['calendar_id']; $this->summary = $data['summary']; $this->description = $data['description']; $this->startsAt = DateUtil::createDateTime($data['start']); $this->endsAt = DateUtil::createDateTime($data['end']); }
/** * @param array $data */ public function populateFromArray(array $data) { if (empty($data['calendar_id'])) { throw new InvalidArgumentException('Invalid calendar_id'); } $this->calendarId = $data['calendar_id']; $this->startsAt = DateUtil::createDateTime($data['start']); $this->endsAt = DateUtil::createDateTime($data['end']); $this->status = self::normalizeStatus($data['free_busy_status']); }
/** * @dataProvider badParams */ public function testInvalidTime($params) { $this->setExpectedException('InvalidArgumentException'); DateUtil::createDateTime($params); }