Skip to content

Commit

Permalink
no longer need to create ufmatch
Browse files Browse the repository at this point in the history
  • Loading branch information
demeritcowboy committed Sep 9, 2024
1 parent 408a365 commit b876536
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions tests/src/FunctionalJavascript/WebformCivicrmTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,18 @@ protected function setUp(): void {
'id' => 'civicrm_webform_test',
'title' => 'CiviCRM Webform Test.' . $CiviCRM_version,
]);
$this->rootUserCid = $this->createIndividual()['id'];
// Create CiviCRM contact for rootUser.
$this->utils->wf_civicrm_api('UFMatch', 'create', [
'uf_id' => $this->rootUser->id(),
'uf_name' => $this->rootUser->getAccountName(),
'contact_id' => $this->rootUserCid,
]);
if (version_compare(\CRM_Core_BAO_Domain::version(), '5.79.alpha1', '<')) {
$this->rootUserCid = $this->createIndividual()['id'];
// Create CiviCRM contact for rootUser.
$this->utils->wf_civicrm_api('UFMatch', 'create', [
'uf_id' => $this->rootUser->id(),
'uf_name' => $this->rootUser->getAccountName(),
'contact_id' => $this->rootUserCid,
]);
}
else {
$this->rootUserCid = $this->getUFMatchRecord($this->rootUser->id())['contact_id'];
}
}

protected function tearDown(): void {
Expand Down

0 comments on commit b876536

Please sign in to comment.