Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Web Services Unit Test

From MoodleDocs
Revision as of 07:30, 23 April 2012 by jerome mouneyrac (talk | contribs) (Created page with "= Delete simpletest web service unit tests With PHP Unit coming up to Moodle 2.3 we'll be removing the web service simpletest unit tests. The reasons are: * these unit tests are ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

= Delete simpletest web service unit tests With PHP Unit coming up to Moodle 2.3 we'll be removing the web service simpletest unit tests. The reasons are:

  • these unit tests are only web service call tests. It would be good to have unit tests for : servers / web service call / external lib / core lib function.
  • some unit tests are just one quick call. It seems sometimes obvious that some other use cases should have been tested.
  • some unit tests create and delete user/category/grouo/course/... in the database. It seems that PHP Unit could facilitate this kind of testing, not sure though...
  • some web service functions don't have unit test at all
  • it's buggy: MDL-30210


Add PHP Unit web service unit tests

I see three kind of unit test related to one web service

  1. external function unit test: This is actually testing xxx_params too as each external funtion should call it. Here the questions is do we want to test xxx_returns at the same time?
  2. web service call test: I think this is required to properly test all servers against all call. here the question is to know if we want to reproduce all the same use case then for external function
  3. core lib function unit test: most of time these kind of unit test don't exist. Note: often the core lib function doesn't exist itself, the external function being a code logic duplication of multiple scripts.

Web service automatic testing

TBD