You are here

function AutoassignroleAdminUserTestCase::testAdminUserFieldsetTitleSettings in Auto Assign Role 7.2

Same name and namespace in other branches
  1. 7 autoassignrole.test \AutoassignroleAdminUserTestCase::testAdminUserFieldsetTitleSettings()

Test admin setting functionality for autoassignrole_user_selection.

See also

http://drupal.org/node/945010

File

./autoassignrole.test, line 546
Creates tests for auto assign role module.

Class

AutoassignroleAdminUserTestCase
Extend the DrupalWebTestCase.

Code

function testAdminUserFieldsetTitleSettings() {

  // 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/people/autoassignrole/user');
  $this
    ->assertField('autoassignrole_user_fieldset_title', 'The autoassignrole_user_fieldset_title field is accessible.');

  // Set autoassignrole_user_fieldset_title to a random string.
  $random_string = $this
    ->randomName();
  $edit['autoassignrole_user_fieldset_title'] = $random_string;
  $this
    ->drupalPost('admin/config/people/autoassignrole/user', $edit, t('Save configuration'));

  // Verify autoassignrole_user_fieldset_title has been saved.
  $this
    ->assertEqual(variable_get('autoassignrole_user_fieldset_title', -1), $random_string, 'autoassignrole_user_fieldset_title has been set to random string');
}