/** * @test * @group metadata * @group contactperson */ public function contact_types_can_be_compared() { $administrative = ContactType::administrative(); $technical = ContactType::technical(); $this->assertTrue($administrative->equals(ContactType::administrative())); $this->assertFalse($administrative->equals($technical)); $this->assertTrue($technical->equals(ContactType::technical())); $this->assertFalse($technical->equals(ContactType::other())); }
/** * @return array */ public function differentContactPersonProvider() { $type = ContactType::technical(); $email = new EmailAddressList(array(new EmailAddress('*****@*****.**'))); $telephone = new TelephoneNumberList(array(new TelephoneNumber('123456'))); $givenName = new GivenName('Homer'); $surname = new Surname('Simpson'); $company = new Company('OpenConext.org'); return array('different type' => array(new ContactPerson(ContactType::other(), $email, $telephone, $givenName, $surname, $company)), 'different email' => array(new ContactPerson($type, new EmailAddressList(array()), $telephone, $givenName, $surname, $company)), 'different telephone' => array(new ContactPerson($type, $email, new TelephoneNumberList(array()), $givenName, $surname, $company)), 'different given name' => array(new ContactPerson($type, $email, $telephone, new GivenName('John'), $surname, $company)), 'no given name' => array(new ContactPerson($type, $email, $telephone, null, $surname, $company)), 'different surname' => array(new ContactPerson($type, $email, $telephone, $givenName, new Surname('Doe'), $company)), 'no surname' => array(new ContactPerson($type, $email, $telephone, $givenName, null, $company)), 'different company' => array(new ContactPerson($type, $email, $telephone, $givenName, $surname, new Company('Babelfish Inc.'))), 'no company' => array(new ContactPerson($type, $email, $telephone, $givenName, $surname, null))); }