You are here

protected function AcquiaLiftWebTestTarget::createTargetingAgent in Acquia Lift Connector 7

3 calls to AcquiaLiftWebTestTarget::createTargetingAgent()
AcquiaLiftWebTestTarget::testAssignVariations in tests/acquia_lift.test
AcquiaLiftWebTestTarget::testCreateTargetAudiences in tests/acquia_lift.test
AcquiaLiftWebTestTarget::testImplementTargetingStructure in tests/acquia_lift.test

File

tests/acquia_lift.test, line 3570
Integration tests for Acquia Lift module.

Class

AcquiaLiftWebTestTarget

Code

protected function createTargetingAgent($label = NULL) {
  AcquiaLiftAPI::setTestInstance();
  if (empty($label)) {
    $label = $this
      ->randomName();
  }
  $agent = new stdClass();
  $agent->label = $label;
  $agent->plugin = 'acquia_lift_target';
  $agent->data = array();
  $agent->machine_name = personalize_generate_machine_name($label, 'personalize_agent_machine_name_exists');
  $agent = personalize_agent_save($agent);
  $this
    ->resetAll();
  return $agent;
}