Exemplo n.º 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;
 }
 /**
  * @test
  * @group metadata
  * @group contactperson
  *
  * @dataProvider typeAndFactoryMethodProvider
  *
  * @param string $contactType
  * @param string $factoryMethod
  */
 public function a_contact_type_created_with_a_valid_type_equals_its_factory_created_version($contactType, $factoryMethod)
 {
     $contactByType = new ContactType($contactType);
     $contactByFactory = ContactType::$factoryMethod();
     $contactByType->equals($contactByFactory);
 }