public function testUpdateContact() { $contact = array('Email' => '*****@*****.**', 'AudienceType' => 'B2B', 'OptInType' => 'Single', 'EmailType' => 'Html', 'Notes' => 'This is an API test contact'); $fields = array('FIRSTNAME' => 'John', 'LASTNAME' => 'Test'); $result = $this->object->CreateContact($contact, $fields); $contact = array('Email' => '*****@*****.**', 'AudienceType' => 'B2B', 'OptInType' => 'Single', 'EmailType' => 'Html', 'Notes' => 'This is an API test contact'); $fields = array('FIRSTNAME' => 'John', 'LASTNAME' => 'UpdatedName'); $result = $this->object->UpdateContact($contact, $fields); $foundContact = $this->object->GetContactByEmail($contact['Email']); $this->assertTrue(is_numeric($foundContact->ID)); $firstnameId = 0; $lastnameId = 0; $this->object->flattenContactFields($foundContact); $this->assertEquals($fields['FIRSTNAME'], $foundContact->fields['FIRSTNAME']); $this->assertEquals($fields['LASTNAME'], $foundContact->fields['LASTNAME']); }