public function testUsesFormatIfAvailable() { $this->reservation->Title = 'mytitle'; $this->reservation->Description = 'mydescription'; $this->reservation->OwnerEmailAddress = 'myemail'; $this->reservation->OwnerOrganization = 'myorg'; $this->reservation->OwnerPhone = 'myphone'; $this->reservation->OwnerPosition = 'myposition'; $this->reservation->ParticipantNames = array('p1', 'p2'); $this->reservation->InviteeNames = array('i1', 'i2'); $this->reservation->StartDate = Date::Now(); $this->reservation->EndDate = Date::Now(); $this->SetConfig('{name} + {title} - {description} {email} {phone} {organization} {position} {participants} {invitees}'); $value = SlotLabelFactory::Create($this->reservation); $this->assertEquals('first last + mytitle - mydescription myemail myphone myorg myposition p1, p2 i1, i2', $value); }
/** * @param SlotLabelFactory|null $factory * @return string */ public function Label($factory = null) { if (empty($factory)) { return SlotLabelFactory::Create($this->_reservation); } return $factory->Format($this->_reservation); }