You are here

function AutoassignroleAdminUserTestCase::testAdminUserDescriptionSettings in Auto Assign Role 7

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

Test admin setting functionality for autoassignrole_user_description.

See also

http://drupal.org/node/945024

File

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

Class

AutoassignroleAdminUserTestCase
Extend the DrupalWebTestCase.

Code

function testAdminUserDescriptionSettings() {

  // 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_description[value]', 'The autoassignrole_user_description field is accessible.');

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

  // Verify autoassignrole_user_fieldset_title has been saved.
  $autoassignrole_user_description = _autoassignrole_get_user_description();
  $this
    ->assertEqual($autoassignrole_user_description['value'], $random_string, 'autoassignrole_user_description has been set to random string');
}