Posted by David Lesieur on June 29, 2009 at 1:17pm
2 followers
Jump to:
| Project: | Role Delegation |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Given the number of combinations made possible with this module, it would be very useful to write automated regression test cases.
Here's a good list of things to test, suggested by TheRec:
- An user with a role which can "assign all roles" -> The user could assign and strip every role for users.
- An user with a role which can add one or more role -> The user could assign and strip only the definied roles for users.
- An user with a role which can "administer users" but cannot assign any role -> The user could not assign or strip off roles but users were still modifiable (as intended).
- An user with a role which can assign/strip its own role -> The user could strip this role off his account and was presented the "Access denied" page after the operation was completed successfully (that is also how it is supposed to be done, so it is ok)
- Users with the "administer permissions" (for D5 it is "administer access control") could in every case assign/strip roles as it is supposed to be.
- User-1 could in every case assign roles as it is supposed to be.
Comments
#1
A Simple Test framework has been added in D7, that covers some of these points. There are currently three test cases, that use a common setup as follows:
Within this setup, there's a "Permissions" test case that just checks that:
Here's how this compares to the above list:
The test framework also includes other test cases, that check whether role bulk add/remove operations and role renaming and deletion work as desired, including that users can/can't use the operations to assign roles that they do/don't have permission for.
The test framework hasn't been ported to D6 yet.