function ProfileTestSelect::testProfileSelectionField

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

File

modules/profile/profile.test, line 223

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.