-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1866afd
commit ece0715
Showing
4 changed files
with
55 additions
and
42 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
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 |
---|---|---|
|
@@ -170,7 +170,11 @@ public function testAddressUpdateUsingChecksum() { | |
'first_name' => 'Pabst', | ||
'last_name' => 'Anthony', | ||
]); | ||
$address = $this->utils->wf_civicrm_api('Address', 'create', [ | ||
$this->utils->wf_civicrm_api('Email', 'create', [ | ||
'contact_id' => $contact['id'], | ||
'email' => "[email protected]", | ||
]); | ||
$this->utils->wf_civicrm_api('Address', 'create', [ | ||
'contact_id' => $contact['id'], | ||
'location_type_id' => "Home", | ||
'is_primary' => 1, | ||
|
@@ -180,17 +184,21 @@ public function testAddressUpdateUsingChecksum() { | |
'state_province_id' => "Alberta", | ||
'postal_code' => 11111, | ||
]); | ||
$contact_cs = \CRM_Contact_BAO_Contact_Utils::generateChecksum($contact['id']); | ||
$contact_cs = $this->utils->wf_civicrm_api4('Contact', 'getChecksum', [ | ||
'contactId' => $contact['id'] | ||
], 0)['checksum']; | ||
|
||
$this->drupalGet($this->webform->toUrl('canonical', ['query' => ['cid1' => $contact['id'], 'cs' => $contact_cs]])); | ||
$this->assertPageNoErrorMessages(); | ||
|
||
// Check if name fields are pre populated with existing values. | ||
$this->assertSession()->fieldValueEquals('First Name', $contact['first_name']); | ||
$this->assertSession()->fieldValueEquals('Last Name', $contact['last_name']); | ||
$this->assertSession()->fieldValueEquals('Email', '[email protected]'); | ||
|
||
// Update the last name | ||
// Update last name & email | ||
$this->getSession()->getPage()->fillField('Last Name', 'Morissette'); | ||
$this->getSession()->getPage()->fillField('Email', '[email protected]'); | ||
$this->getSession()->getPage()->pressButton('Next >'); | ||
$this->assertPageNoErrorMessages(); | ||
$canada_id = $this->utils->wf_civicrm_api('Country', 'getvalue', [ | ||
|
@@ -210,10 +218,6 @@ public function testAddressUpdateUsingChecksum() { | |
$this->assertSession()->fieldValueEquals('Postal Code', 11111); | ||
|
||
// Change the street & city value in the address fields. | ||
$address = [ | ||
'Street Address' => '123 Defence Colony Updated', | ||
'City' => 'Calgary', | ||
]; | ||
$this->getSession()->getPage()->fillField('Street Address', '123 Defence Colony Updated'); | ||
$this->getSession()->getPage()->fillField('City', 'Calgary'); | ||
|
||
|
@@ -232,6 +236,7 @@ public function testAddressUpdateUsingChecksum() { | |
$expected_values = [ | ||
'first_name' => 'Pabst', | ||
'last_name' => 'Morissette', | ||
'email' => '[email protected]', | ||
'street_address' => "123 Defence Colony Updated", | ||
'city' => "Calgary", | ||
'country_id' => $canada_id, | ||
|