Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The default data generated by this dataset load can be access directly in unit tests with the following functions:

functiondescriptiondirect access in unit test
get_base_adminreturns user data (an array) for the default admin user$this->admin
get_base_studentreturns user data (an array) for the default student user$this->studnet
get_base_modulereturns user data (an array) for the default module$this->module
get_base_facultyreturns user data (an array) for the default faculty$this->faculty
get_base_schoolreturns 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:

fucntiondescription

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:

functiondescription

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.

...