...
The default data generated by this dataset load can be access directly in unit tests with the following functions:
function | description | direct access in unit test |
---|---|---|
get_base_admin | returns user data (an array) for the default admin user | $this->admin |
get_base_student | returns user data (an array) for the default student user | $this->studnet |
get_base_module | returns user data (an array) for the default module | $this->module |
get_base_faculty | returns user data (an array) for the default faculty | $this->faculty |
get_base_school | returns user data (an array) for the default school | $this->school |
The internal rogo id can also be accessed for objects within the test database using the following functions:
fucntion | description |
---|---|
get_user_id(name) | get the id of the user |
get_module_id(name) | get the id of the module |
get_faculty_id(name) | get the id of the faculty |
get_school_id(name) | get the id of the school |
The active user can be set using hte following function:
function | description |
---|---|
set_active_user(id, state, impersonate) | id = the user id state = USEROBJECT_DEEFAULT - standard user USEROBJECT_DEMO - user running in demo mode USEROBJECT_IMPERSONATE - user is impersonating someone else impersonate = the user id of the user to impersonate |
Data Generation
Each unit tests must implement the datageneration function. Within this function additional data is loaded into the tes database required by the test.
...