You are here

protected function AcquiaLiftWebTestBase::createPersonalizedArticleField in Acquia Lift Connector 7.2

Adds a personalizable field to the article node type.

3 calls to AcquiaLiftWebTestBase::createPersonalizedArticleField()
AcquiaLiftWebTestCampaignWizardVariations::testWhatFieldsForm in tests/acquia_lift.test
Test the personalize fields view of the "What" campaign subform.
AcquiaLiftWebTestTarget::testAgentEditableMessaging in tests/acquia_lift.test
Tests messaging for available operations based on agent status.
AcquiaLiftWebTestWorkflow::testPersonalizeFieldsAutoCreateGoal in tests/acquia_lift.test
Tests automatic creation of a goal for personalized fields and auto- starting of the campaign.

File

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

Class

AcquiaLiftWebTestBase
@file Integration tests for Acquia Lift module.

Code

protected function createPersonalizedArticleField() {

  // Add personalizable field to the article node type.
  $field = array(
    'type' => 'text',
    'field_name' => 'article_headline',
    'cardinality' => -1,
    'settings' => array(
      'personalize' => array(
        'enabled' => 1,
        'agent_type' => 'acquia_lift_target',
        'options' => array(),
        'create_goal' => 1,
      ),
    ),
  );
  field_create_field($field);
  $instance = array(
    'field_name' => 'article_headline',
    'entity_type' => 'node',
    'label' => 'Personalizable Headline',
    'bundle' => 'article',
    'required' => FALSE,
  );
  field_create_instance($instance);
}