コード例 #1
0
 /**
  * @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;
 }
コード例 #2
0
 /**
  * @test
  * @group metadata
  * @group contactperson
  */
 public function deserializing_a_serialized_telephone_number_list_results_in_an_equal_value_object()
 {
     $numberOne = new TelephoneNumber('123');
     $numberTwo = new TelephoneNumber('456');
     $original = new TelephoneNumberList(array($numberTwo, $numberOne, $numberTwo));
     $deserialized = TelephoneNumberList::deserialize($original->serialize());
     $this->assertTrue($original->equals($deserialized));
 }