function UserImportProfile::profileFieldsCreate in User Import 5
Same name and namespace in other branches
- 8 tests/user_import_profile.test \UserImportProfile::profileFieldsCreate()
 
* create profile fields
1 call to UserImportProfile::profileFieldsCreate()
- UserImportProfile::testCreateImport in tests/
user_import_profile.test  - * User with right permissions creates import (with new settings) * - test import of user data into Profile module
 
File
- tests/
user_import_profile.test, line 49  
Class
- UserImportProfile
 - Test import of user data into Profile module
 
Code
function profileFieldsCreate() {
  // Textfield
  $edit = array(
    'category' => 'Name',
    'title' => 'First Name',
    'name' => 'profile_first_name',
  );
  $this
    ->drupalPostRequest('admin/user/profile/add/textfield', $edit, t('Save field'));
  // Textfield
  $edit = array(
    'category' => 'Name',
    'title' => 'Last Name',
    'name' => 'profile_last_name',
  );
  $this
    ->drupalPostRequest('admin/user/profile/add/textfield', $edit, t('Save field'));
  // Textarea
  $edit = array(
    'category' => 'Biography',
    'title' => 'CV',
    'name' => 'profile_cv',
  );
  $this
    ->drupalPostRequest('admin/user/profile/add/textarea', $edit, t('Save field'));
  // Checkbox
  $edit = array(
    'category' => 'Contact Details',
    'title' => 'Can Be Contacted',
    'name' => 'profile_contact_permission',
  );
  $this
    ->drupalPostRequest('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
    ->drupalPostRequest('admin/user/profile/add/selection', $edit, t('Save field'));
  // Freeform List
  $edit = array(
    'category' => 'Biography',
    'title' => 'Interests',
    'name' => 'profile_interests',
  );
  $this
    ->drupalPostRequest('admin/user/profile/add/list', $edit, t('Save field'));
  // URL
  $edit = array(
    'category' => 'Biography',
    'title' => 'Blog',
    'name' => 'profile_blog',
  );
  $this
    ->drupalPostRequest('admin/user/profile/add/url', $edit, t('Save field'));
  // Date
  $edit = array(
    'category' => 'Biography',
    'title' => 'Birthday',
    'name' => 'profile_birthday',
  );
  $this
    ->drupalPostRequest('admin/user/profile/add/date', $edit, t('Save field'));
}