function AutoassignroleAdminAutoRoleTestCase::testAdminSettings in Auto Assign Role 6
Same name and namespace in other branches
- 6.2 tests/autoassignrole.test \AutoassignroleAdminAutoRoleTestCase::testAdminSettings()
File
- tests/autoassignrole.test, line 147
- Autoassignrole functionality tests.
Class
- AutoassignroleAdminAutoRoleTestCase
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('automatic_role_assignment');
$this
->drupalPost('admin/user/autoassignrole', $edit, t('Save'));
$this
->assertEqual(_autoassignrole_get_settings('auto_active'), 1, 'Automatic Role Assignment has been enabled');
$this
->validate($edit, 'Automatic Role Assignment');
$edit['auto_active'] = 0;
foreach ($this->roles as $rid => $role) {
$edit["auto_roles[{$rid}]"] = FALSE;
}
$this
->drupalPost('admin/user/autoassignrole', $edit, t('Save'));
$this
->validate($edit, 'Automatic Role Assignment');
}