-
-
Notifications
You must be signed in to change notification settings - Fork 825
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18076 from MegaphoneJon/better-on-behalf-of-2
[REF] change deprecated function to API4 call
- Loading branch information
Showing
2 changed files
with
21 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1338,7 +1338,7 @@ public function testProcessOnBehalfOrganization() { | |
'postal_code' => '222222', | ||
'country' => 'United States', | ||
]; | ||
$contactID = $this->individualCreate(); | ||
$originalContactId = $contactID = $this->individualCreate(); | ||
$orgId = $this->organizationCreate(['organization_name' => 'testorg1']); | ||
$orgCount = $this->callAPISuccessGetCount('Contact', [ | ||
'contact_type' => "Organization", | ||
|
@@ -1347,7 +1347,7 @@ public function testProcessOnBehalfOrganization() { | |
$this->assertEquals($orgCount, 1); | ||
|
||
$values = $params = []; | ||
$behalfOrganization = [ | ||
$originalBehalfOrganization = $behalfOrganization = [ | ||
'organization_name' => 'testorg1', | ||
'phone' => [ | ||
1 => [ | ||
|
@@ -1383,9 +1383,10 @@ public function testProcessOnBehalfOrganization() { | |
'country-3' => 1, | ||
'state_province-3' => 1, | ||
]; | ||
CRM_Contribute_Form_Contribution_Confirm::processOnBehalfOrganization($behalfOrganization, $contactID, $values, $params, $fields); | ||
$empty = []; | ||
CRM_Contribute_Form_Contribution_Confirm::processOnBehalfOrganization($behalfOrganization, $contactID, $empty, $empty, $empty); | ||
|
||
//Check whether new organisation is not created. | ||
//Check whether new organisation is created. | ||
$result = $this->callAPISuccess('Contact', 'get', [ | ||
'contact_type' => "Organization", | ||
'organization_name' => "testorg1", | ||
|
@@ -1399,7 +1400,7 @@ public function testProcessOnBehalfOrganization() { | |
|
||
//Check if alert is assigned to params if more than 1 dupe exists. | ||
$orgId = $this->organizationCreate(['organization_name' => 'testorg1', 'email' => '[email protected]']); | ||
CRM_Contribute_Form_Contribution_Confirm::processOnBehalfOrganization($behalfOrganization, $contactID, $values, $params, $fields); | ||
CRM_Contribute_Form_Contribution_Confirm::processOnBehalfOrganization($originalBehalfOrganization, $originalContactId, $values, $params, $fields); | ||
$this->assertEquals($params['onbehalf_dupe_alert'], 1); | ||
} | ||
|
||
|