You are here

function UserImportProfileTestCase::profileFieldsCreate in User Import 6.4

Same name and namespace in other branches
  1. 6.2 user_import.test \UserImportProfileTestCase::profileFieldsCreate()

create profile fields

1 call to UserImportProfileTestCase::profileFieldsCreate()
UserImportProfileTestCase::testCreateImport in ./user_import.test
User with right permissions creates import (with new settings)

File

./user_import.test, line 476

Class

UserImportProfileTestCase
Test import of user data into Profile module

Code

function profileFieldsCreate() {

  // Textfield
  $edit = array(
    'category' => 'Name',
    'title' => 'First Name',
    'name' => 'profile_first_name',
  );
  $this
    ->drupalPost('admin/user/profile/add/textfield', $edit, t('Save field'));

  // Textfield
  $edit = array(
    'category' => 'Name',
    'title' => 'Last Name',
    'name' => 'profile_last_name',
  );
  $this
    ->drupalPost('admin/user/profile/add/textfield', $edit, t('Save field'));

  // Textarea
  $edit = array(
    'category' => 'Biography',
    'title' => 'CV',
    'name' => 'profile_cv',
  );
  $this
    ->drupalPost('admin/user/profile/add/textarea', $edit, t('Save field'));

  // Checkbox
  $edit = array(
    'category' => 'Contact Details',
    'title' => 'Can Be Contacted',
    'name' => 'profile_contact_permission',
  );
  $this
    ->drupalPost('admin/user/profile/add/checkbox', $edit, t('Save field'));

  // List
  $edit = array(
    'category' => 'Contact Details',
    'title' => 'Contact Preference',
    'name' => 'profile_contact_preference',
    'options' => 'email,telephone,post',
  );
  $this
    ->drupalPost('admin/user/profile/add/selection', $edit, t('Save field'));

  // Freeform List
  $edit = array(
    'category' => 'Biography',
    'title' => 'Interests',
    'name' => 'profile_interests',
  );
  $this
    ->drupalPost('admin/user/profile/add/list', $edit, t('Save field'));

  // URL
  $edit = array(
    'category' => 'Biography',
    'title' => 'Blog',
    'name' => 'profile_blog',
  );
  $this
    ->drupalPost('admin/user/profile/add/url', $edit, t('Save field'));

  // Date
  $edit = array(
    'category' => 'Biography',
    'title' => 'Birthday',
    'name' => 'profile_birthday',
  );
  $this
    ->drupalPost('admin/user/profile/add/date', $edit, t('Save field'));
}