|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| setUp () | |
| testRun () | |
| moodle_group_get_groups ($client) | |
| moodle_webservice_get_siteinfo ($client) | |
| moodle_user_get_users_by_id ($client) | |
| core_course_get_contents ($client) | |
| moodle_enrol_manual_enrol_users ($client) | |
| moodle_enrol_get_enrolled_users ($client) | |
| moodle_course_get_courses ($client) | |
| moodle_course_create_courses ($client) | |
| moodle_user_create_users ($client) | |
| moodle_user_delete_users ($client) | |
| moodle_user_update_users ($client) | |
| moodle_role_assign ($client) | |
| moodle_role_unassign ($client) | |
| moodle_group_get_course_groups ($client) | |
| moodle_group_get_groupmembers ($client) | |
| moodle_group_add_groupmembers ($client) | |
| moodle_group_delete_groupmembers ($client) | |
| moodle_group_create_groups ($client) | |
| moodle_group_delete_groups ($client) | |
| moodle_message_send_messages ($client) | |
| moodle_notes_create_notes ($client) | |
Data Fields | |
| $testtoken | |
| $testrest | |
| $testxmlrpc | |
| $testsoap | |
| $timerrest | |
| $timerxmlrpc | |
| $timersoap | |
| $readonlytests | |
| $writetests | |
How to configure this unit tests: 0- Enable the web service you wish to test in the Moodle administration 1- Create a service with all functions in the Moodle administration 2- Create a token associate this service and to an admin (or a user with all required capabilities) 3- Configure setUp() function: a- write the token b- activate the protocols you wish to test c- activate the functions you wish to test (readonlytests and writetests arrays) d- set the number of time the web services are run Do not run WRITE test function on a production site as they impact the DB (even though every test should clean the modified data)
How to write a new function: 1- Add the function name to the array readonlytests/writetests 2- Set it as false when you commit! 3- write the function - Do not prefix the function name by 'test'
Definition at line 48 of file testwebservice.php.
| core_course_get_contents | ( | $ | client | ) |
Definition at line 251 of file testwebservice.php.
| moodle_course_create_courses | ( | $ | client | ) |
Test data
Definition at line 468 of file testwebservice.php.

| moodle_course_get_courses | ( | $ | client | ) |
| moodle_enrol_get_enrolled_users | ( | $ | client | ) |
| moodle_enrol_manual_enrol_users | ( | $ | client | ) |
This test will: 1- create a user (core call) 2- enrol this user in the courses supporting enrolment 3- unenrol this user (core call)
Definition at line 277 of file testwebservice.php.

| moodle_group_add_groupmembers | ( | $ | client | ) |
| moodle_group_create_groups | ( | $ | client | ) |
| moodle_group_delete_groupmembers | ( | $ | client | ) |
| moodle_group_delete_groups | ( | $ | client | ) |
| moodle_group_get_course_groups | ( | $ | client | ) |
READ ONLY test TODO: find a better solution that running web service for each course in the system For each courses, test the number of groups
| object | $client |
Definition at line 1116 of file testwebservice.php.

| moodle_group_get_groupmembers | ( | $ | client | ) |
READ ONLY test Test that the same number of members are returned for each existing group in the system
| object | $client |
Definition at line 1136 of file testwebservice.php.

| moodle_group_get_groups | ( | $ | client | ) |
| moodle_message_send_messages | ( | $ | client | ) |
Definition at line 1526 of file testwebservice.php.
| moodle_notes_create_notes | ( | $ | client | ) |
Definition at line 1543 of file testwebservice.php.
| moodle_role_assign | ( | $ | client | ) |
| moodle_role_unassign | ( | $ | client | ) |
| moodle_user_create_users | ( | $ | client | ) |
| moodle_user_delete_users | ( | $ | client | ) |
| moodle_user_get_users_by_id | ( | $ | client | ) |
| moodle_user_update_users | ( | $ | client | ) |
| moodle_webservice_get_siteinfo | ( | $ | client | ) |
| setUp | ( | ) |
Definition at line 60 of file testwebservice.php.
| testRun | ( | ) |
Definition at line 108 of file testwebservice.php.
| $readonlytests |
Definition at line 57 of file testwebservice.php.
| $testrest |
Definition at line 51 of file testwebservice.php.
| $testsoap |
Definition at line 53 of file testwebservice.php.
| $testtoken |
Definition at line 50 of file testwebservice.php.
| $testxmlrpc |
Definition at line 52 of file testwebservice.php.
| $timerrest |
Definition at line 54 of file testwebservice.php.
| $timersoap |
Definition at line 56 of file testwebservice.php.
| $timerxmlrpc |
Definition at line 55 of file testwebservice.php.
| $writetests |
Definition at line 58 of file testwebservice.php.