public function testUpdateProfile() { $this->validUserProfileDto->setFirstName('Shesa'); $this->validUserProfileDto->setLastName('Nuthertest'); $this->hasSendGridPatchRequest('profile', $this->validUserProfileDto->toArray(), $this->validUserProfileDto->getUpdatedFields()); $actualUserProfileDto = $this->userApi->updateProfile($this->validUserProfileDto); // Unset the updated fields since the result profile won't have modified fields $this->validUserProfileDto->setUpdatedFields([]); $this->assertEquals($this->validUserProfileDto, $actualUserProfileDto); }
/** * Updates the User Profile with any changed data (via setters). * @param UserProfileDto $userProfileDto * @return \iDimensionz\SendGridWebApiV3\Api\Users\UserProfileDto */ public function updateProfile(UserProfileDto $userProfileDto) { $changedFieldData = $userProfileDto->getUpdatedFields(); $profileContent = $this->patch('profile', $changedFieldData); $userProfileDto = new UserProfileDto($profileContent); return $userProfileDto; }
public function testConstruct() { $this->assertUserProfile(); $this->assertEquals([], $this->userProfile->getUpdatedFields()); }