Revision 582db59d
Added by Assos Assos almost 9 years ago
drupal7/modules/user/user.test | ||
---|---|---|
2095 | 2095 |
$this->assertFalse(user_role_load_by_name($old_name), 'The role can no longer be retrieved from the database using its old name.'); |
2096 | 2096 |
$this->assertTrue(is_object(user_role_load_by_name($role_name)), 'The role can be retrieved from the database using its new name.'); |
2097 | 2097 |
|
2098 |
// Test deleting a role. |
|
2098 |
// Test deleting the default administrator role. |
|
2099 |
$role_name = 'administrator'; |
|
2100 |
$role = user_role_load_by_name($role_name); |
|
2099 | 2101 |
$this->drupalPost("admin/people/permissions/roles/edit/{$role->rid}", NULL, t('Delete role')); |
2100 | 2102 |
$this->drupalPost(NULL, NULL, t('Delete')); |
2101 | 2103 |
$this->assertText(t('The role has been deleted.'), 'The role has been deleted'); |
2102 | 2104 |
$this->assertNoLinkByHref("admin/people/permissions/roles/edit/{$role->rid}", 'Role edit link removed.'); |
2103 | 2105 |
$this->assertFalse(user_role_load_by_name($role_name), 'A deleted role can no longer be loaded.'); |
2106 |
// Make sure this role is no longer configured as the administrator role. |
|
2107 |
$this->assertNull(variable_get('user_admin_role'), 'The administrator role is no longer configured as the administrator role.'); |
|
2104 | 2108 |
|
2105 | 2109 |
// Make sure that the system-defined roles cannot be edited via the user |
2106 | 2110 |
// interface. |
Also available in: Unified diff
Update Drupal core to version 7.40