Moodle  2.2.1
http://www.collinsharper.com
webservice_test Class Reference
Inheritance diagram for webservice_test:
Collaboration diagram for webservice_test:

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

Detailed Description

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.


Member Function Documentation

core_course_get_contents ( client)

Definition at line 251 of file testwebservice.php.

Test data

Definition at line 468 of file testwebservice.php.

Here is the call graph for this function:

Definition at line 388 of file testwebservice.php.

Here is the call graph for this function:

Definition at line 353 of file testwebservice.php.

Here is the call graph for this function:

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.

Here is the call graph for this function:

Definition at line 1160 of file testwebservice.php.

Here is the call graph for this function:

Definition at line 1340 of file testwebservice.php.

Here is the call graph for this function:

Definition at line 1250 of file testwebservice.php.

Here is the call graph for this function:

Definition at line 1434 of file testwebservice.php.

Here is the call graph for this function:

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

Parameters:
object$client

Definition at line 1116 of file testwebservice.php.

Here is the call graph for this function:

READ ONLY test Test that the same number of members are returned for each existing group in the system

Parameters:
object$client

Definition at line 1136 of file testwebservice.php.

Here is the call graph for this function:

moodle_group_get_groups ( client)

Definition at line 210 of file testwebservice.php.

Here is the call graph for this function:

Definition at line 1526 of file testwebservice.php.

Definition at line 1543 of file testwebservice.php.

moodle_role_assign ( client)

Definition at line 997 of file testwebservice.php.

Here is the call graph for this function:

moodle_role_unassign ( client)

Definition at line 1051 of file testwebservice.php.

Here is the call graph for this function:

moodle_user_create_users ( client)

Definition at line 580 of file testwebservice.php.

Here is the call graph for this function:

moodle_user_delete_users ( client)

Definition at line 710 of file testwebservice.php.

Here is the call graph for this function:

Definition at line 236 of file testwebservice.php.

Here is the call graph for this function:

moodle_user_update_users ( client)

Definition at line 816 of file testwebservice.php.

Here is the call graph for this function:

Definition at line 224 of file testwebservice.php.

Here is the call graph for this function:

setUp ( )

Definition at line 60 of file testwebservice.php.

testRun ( )

Definition at line 108 of file testwebservice.php.


Field Documentation

$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.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations