Index: CHANGELOG.txt =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/autoassignrole/CHANGELOG.txt,v retrieving revision 1.11 diff -u -p -r1.11 CHANGELOG.txt --- CHANGELOG.txt 14 Nov 2010 16:34:55 -0000 1.11 +++ CHANGELOG.txt 14 Nov 2010 16:40:52 -0000 @@ -2,6 +2,7 @@ autoassignrole 7.0, xxxx-xx-xx (development version) ------------------------ +- [#945016] Administrator sets the user role field title. - [#945024] Administrator set roles description exposed when end user selects roles. - [#945010] Administrator sets a fieldset title for roles exposed to end user. Index: autoassignrole.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/autoassignrole/autoassignrole.admin.inc,v retrieving revision 1.10 diff -u -p -r1.10 autoassignrole.admin.inc --- autoassignrole.admin.inc 14 Nov 2010 16:34:55 -0000 1.10 +++ autoassignrole.admin.inc 14 Nov 2010 16:40:52 -0000 @@ -159,5 +159,15 @@ function autoassignrole_user_settings() '#maxlength' => 128 ); + $form['autoassignrole_user_title'] = array( + '#type' => 'textfield', + '#title' => t('User Role Title'), + '#description' => t('The title of the field that contains the role options the end user sees during registration.'), + '#default_value' => variable_get('autoassignrole_user_title', t('Role')), + '#size' => 60, + '#maxlength' => 128, + '#required' => FALSE, + ); + return system_settings_form($form); } Index: autoassignrole.test =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/autoassignrole/autoassignrole.test,v retrieving revision 1.11 diff -u -p -r1.11 autoassignrole.test --- autoassignrole.test 14 Nov 2010 16:34:55 -0000 1.11 +++ autoassignrole.test 14 Nov 2010 16:40:52 -0000 @@ -506,4 +506,35 @@ class AutoassignroleAdminSettingsTestCas ); } +/** + * Test admin setting functionality for autoassignrole_user_title. + * @see http://drupal.org/node/945016 + */ + function testAdminUserTitle() { + // Create a new user who can access the administration settings + $this->drupalLogin($this->admin_user); + + // Check that the user can see the admin settings page. + $this->drupalGet('admin/config/autoassignrole/user'); + $this->assertField( + 'autoassignrole_user_title', + 'The autoassignrole_user_title field is accessible.' + ); + + // Set autoassignrole_user_title to a random string. + $random_string = $this->randomName(); + $edit['autoassignrole_user_title'] = $random_string; + $this->drupalPost( + 'admin/config/autoassignrole/user', + $edit, + t('Save configuration') + ); + + // Verify autoassignrole_user_title has been saved. + $this->assertEqual( + variable_get('autoassignrole_user_title', -1), + $random_string, + 'autoassignrole_user_title has been set to random string' + ); + } }