/** * @test * @group metadata * @group contactperson */ public function deserializing_a_serialized_company_results_in_an_equal_value_object() { $companyName = 'OpenConext.org'; $original = new Company($companyName); $deserialized = Company::deserialize($original->serialize()); $this->assertTrue($original->equals($deserialized)); $this->assertEquals($companyName, $deserialized->getCompany()); }
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); }