protected function AcquiaLiftWebTestBase::createTargetingAgent in Acquia Lift Connector 7.2
A helper function to create an acquia_lift_target agent.
Parameters
string $label: (Optional) The label for the new agent.
Return value
stdClass The newly created agent data.
33 calls to AcquiaLiftWebTestBase::createTargetingAgent()
- AcquiaLiftWebTestAgentAdmin::testAgentList in tests/
acquia_lift.test - AcquiaLiftWebTestBase::createTargetingAgentWithNestedTest in tests/
acquia_lift.test - AcquiaLiftWebTestCampaignWizard::testGoals in tests/
acquia_lift.test - Test goals form.
- AcquiaLiftWebTestCampaignWizard::testGoalTypeSelect in tests/
acquia_lift.test - Test goals type form.
- AcquiaLiftWebTestCampaignWizardReview::testReviewFormStatus in tests/
acquia_lift.test - Tests review form status changes.
File
- tests/
acquia_lift.test, line 79 - Integration tests for Acquia Lift module.
Class
- AcquiaLiftWebTestBase
- @file Integration tests for Acquia Lift module.
Code
protected function createTargetingAgent($label = NULL, $data = array()) {
if (empty($label)) {
$label = $this
->randomName();
}
$agent = new stdClass();
$agent->label = $label;
$agent->plugin = 'acquia_lift_target';
$agent->data = $data;
$agent->machine_name = personalize_generate_machine_name($label, 'personalize_agent_machine_name_exists');
$agent = personalize_agent_save($agent);
$this
->resetAll();
$this
->resetAll();
return $agent;
}