-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear address object if all properties are empty
- Loading branch information
1 parent
9d25110
commit 3d66f57
Showing
3 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,6 +109,21 @@ function test_Users_Save_Natural() { | |
$this->assertIdenticalInputProps($userSaved, $john); | ||
$this->assertIdenticalInputProps($userFetched, $john); | ||
} | ||
|
||
function test_Users_Save_NaturalAndClearAddresIfNeeded() { | ||
$user = new \MangoPay\UserNatural(); | ||
$user->FirstName = "John"; | ||
$user->LastName = "Doe"; | ||
$user->Email = "[email protected]"; | ||
$user->Birthday = mktime(0, 0, 0, 12, 21, 1975); | ||
$user->Nationality = "FR"; | ||
$user->CountryOfResidence = "FR"; | ||
$newUser = $this->_api->Users->Create($user); | ||
|
||
$userSaved = $this->_api->Users->Update($newUser); | ||
|
||
$this->assertTrue($userSaved->Id > 0); | ||
} | ||
|
||
function test_Users_Save_Legal() { | ||
$matrix = $this->getMatrix(); | ||
|
@@ -121,6 +136,23 @@ function test_Users_Save_Legal() { | |
$this->assertIdenticalInputProps($userFetched, $matrix); | ||
} | ||
|
||
function test_Users_Save_LegalAndClearAddresIfNeeded() { | ||
$user = new \MangoPay\UserLegal(); | ||
$user->Name = "MartixSampleOrg"; | ||
$user->Email = "[email protected]"; | ||
$user->LegalPersonType = \MangoPay\LegalPersonType::Business; | ||
$user->LegalRepresentativeFirstName = "FirstName"; | ||
$user->LegalRepresentativeLastName = "LastName"; | ||
$user->LegalRepresentativeBirthday = mktime(0, 0, 0, 12, 21, 1975); | ||
$user->LegalRepresentativeNationality = "FR"; | ||
$user->LegalRepresentativeCountryOfResidence = "FR"; | ||
$newUser = $this->_api->Users->Create($user); | ||
|
||
$userSaved = $this->_api->Users->Update($newUser); | ||
|
||
$this->assertTrue($userSaved->Id > 0); | ||
} | ||
|
||
function test_Users_CreateBankAccount_IBAN() { | ||
$john = $this->getJohn(); | ||
$account = $this->getJohnsAccount(); | ||
|