You are here

protected function WebformCivicrmTestBase::enableComponent in Webform CiviCRM Integration 8.5

Enable Component in CiviCRM.

Parameters

string $componentName:

1 call to WebformCivicrmTestBase::enableComponent()
CaseSubmissionTest::testCaseSubmission in tests/src/FunctionalJavascript/CaseSubmissionTest.php
Test Case Submission.

File

tests/src/FunctionalJavascript/WebformCivicrmTestBase.php, line 441

Class

WebformCivicrmTestBase

Namespace

Drupal\Tests\webform_civicrm\FunctionalJavascript

Code

protected function enableComponent($componentName) {
  $enabledComponents = $this->utils
    ->wf_crm_get_civi_setting('enable_components');
  if (in_array($componentName, $enabledComponents)) {

    // component is already enabled
    return;
  }
  $enabledComponents[] = $componentName;
  $this->utils
    ->wf_civicrm_api('Setting', 'create', [
    'enable_components' => $enabledComponents,
  ]);
}