/** * @param ContactPerson $other * @return bool */ public function equals(ContactPerson $other) { if (!$this->contactType->equals($other->contactType)) { return false; } if (!$this->emailAddressList->equals($other->emailAddressList)) { return false; } if (!$this->telephoneNumberList->equals($other->telephoneNumberList)) { return false; } if ($this->givenName != $other->givenName) { return false; } if ($this->surname != $other->surname) { return false; } if ($this->company != $other->company) { return false; } return true; }
/** * @test * @group metadata * @group contactperson */ public function deserializing_a_serialized_email_address_list_results_in_an_equal_value_object() { $emailOne = new EmailAddress('*****@*****.**'); $emailTwo = new EmailAddress('*****@*****.**'); $original = new EmailAddressList(array($emailOne, $emailTwo)); $deserialized = EmailAddressList::deserialize($original->serialize()); $this->assertTrue($original->equals($deserialized)); }