function ProfileTestSelect::testProfileSelectionField

7.x profile.test ProfileTestSelect::testProfileSelectionField()

Create a list selection field, give it a value, update and delete the field.

File

drupal-7.x/modules/profile/profile.test, line 223
Tests for profile.module.

Class

ProfileTestSelect

Code

function testProfileSelectionField() {
  $this->drupalLogin($this->admin_user);

  $edit = array(
    'options' => implode("\n", range(1, 10)),
  );
  $field = $this->createProfileField('selection', 'simpletest', $edit);

  $this->setProfileField($field, rand(1, 10));

  $edit = array(
    'name' => $field['form_name'],
    'title' => $this->randomName(),
    'category' => $field['category'],
    'explanation' => $this->randomName(),
  );
  $field = $this->updateProfileField($field['fid'], $field['type'], $edit);
  $this->deleteProfileField($field);
}