/** * @test * @group metadata * @group contactperson */ public function a_contact_person_can_be_cast_to_string() { $contactPerson = new ContactPerson(ContactType::technical(), new EmailAddressList(array(new EmailAddress('*****@*****.**'))), new TelephoneNumberList(array(new TelephoneNumber('123456'))), new GivenName('Homer'), new Surname('Simpson'), new Company('OpenConext.org')); $this->assertStringStartsWith('ContactPerson', (string) $contactPerson); }
/** * @return ContactPerson */ private function getJohnContact() { return new ContactPerson(ContactType::technical(), new EmailAddressList(array(new EmailAddress('*****@*****.**'))), new TelephoneNumberList(array(new TelephoneNumber('123987'))), new GivenName('John'), new Surname('Doe'), new Company('OpenConext.org')); }
/** * @test * @group metadata * @group contactperson */ public function a_contact_type_can_be_cast_to_string() { $type = ContactType::technical(); $this->assertEquals(ContactType::TYPE_TECHNICAL, (string) $type); }
public function serialize() { return array('contact_type' => $this->contactType->serialize(), 'email_address_list' => $this->emailAddressList->serialize(), 'telephone_number_list' => $this->telephoneNumberList->serialize(), 'given_name' => $this->givenName ? $this->givenName->serialize() : null, 'surname' => $this->surname ? $this->surname->serialize() : null, 'company' => $this->company ? $this->company->serialize() : null); }