function AutoassignroleAdminAllowUserChoiceTestCase::testAdminSettings in Auto Assign Role 6
Same name and namespace in other branches
- 6.2 tests/autoassignrole.test \AutoassignroleAdminAllowUserChoiceTestCase::testAdminSettings()
File
- tests/autoassignrole.test, line 259
- Autoassignrole functionality tests.
Class
- AutoassignroleAdminAllowUserChoiceTestCase
Code
function testAdminSettings() {
$this
->drupalLogin($this->admin_user);
$this
->drupalGet('admin/user/autoassignrole');
$this
->assertRaw('Automatic Role Assignment', 'The Automatic Role Assignment section exists on the AAR admin page');
$edit = $this
->getEditValues('user_choice');
$edit['user_multiple'] = 1;
$edit['user_selection'] = 0;
$this
->drupalPost('admin/user/autoassignrole', $edit, t('Save'));
$this
->assertNotEqual($edit['user_active'], _autoassignrole_get_settings('user_active'), 'Allow User to Choose: user_active failed validation correctly if role Selection is set to Multiple Roles then Selection Method can not be Radio Buttons');
$edit['user_multiple'] = 0;
$this
->drupalPost('admin/user/autoassignrole', $edit, t('Save'));
foreach ($edit as $key => $value) {
$this
->assertEqual($value, _autoassignrole_get_settings($key), 'Allow User to Choose: ' . $key . ' was set properly');
}
}