You are here

protected function AcquiaLiftWebTestBase::createUserProfileField in Acquia Lift Connector 7

Same name and namespace in other branches
  1. 7.2 tests/acquia_lift.test \AcquiaLiftWebTestBase::createUserProfileField()

Creates a user profile field which can be used for targeting.

Return value

array An associative array representing the field.

1 call to AcquiaLiftWebTestBase::createUserProfileField()
AcquiaLiftWebTestAgentAdmin::testSyncOptionSets in tests/acquia_lift.test
Tests syncing of Option Set information to Acquia Lift.

File

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

Class

AcquiaLiftWebTestBase
@file Integration tests for Acquia Lift module.

Code

protected function createUserProfileField() {
  $field = array(
    'field_name' => 'field_' . drupal_strtolower($this
      ->randomName()),
    'type' => 'text',
    'cardinality' => 1,
  );
  field_create_field($field);
  $fieldInstance = array(
    'field_name' => $field['field_name'],
    'entity_type' => 'user',
    'bundle' => 'user',
    'settings' => array(
      'user_register_form' => FALSE,
    ),
  );
  field_create_instance($fieldInstance);
  return $field;
}