Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-30210

Fix the broken web service unit tests

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • None
    • 2.1.4, 2.2
    • Web Services
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • Hide

      Edit the /webservice/simpletest/testwebservice.php file:
      1- set to true all protocols.
      2- set to true all functions.
      3- Run the unit tests twice in the Moodle admin.

      Show
      Edit the /webservice/simpletest/testwebservice.php file: 1- set to true all protocols. 2- set to true all functions. 3- Run the unit tests twice in the Moodle admin.

      There are many issues with the web service unit tests that I fixed in https://github.com/mouneyrac/local_wstesting/blob/master/simpletest/testwebservice.php

      From memory the fixes are:

      • REST server does not accept object parameters. I casted all object into array.
      • some parameters name were incorrect. XML-RPC and SOAP were bypassing wrong name, only looking at the order. By REST was failing.
      • Some functions were creating trash data and failed on second run.
      • one of the new Moodle 2.2 web service function test is new: core_enrol_get_enrolled_users

      Fixing in for 2.2 will be easy (it's about copying the file). Backporting in 2.1/2.0 is just a bit more work. After copying the file, take care about putting back the old moodle_enrol_get_enrolled_users instead core_enrol_get_enrolled_users, and also remove the possibility to test REST server (REST-JSON server only available in 2.2).

            jerome Jérôme Mouneyrac
            jerome Jérôme Mouneyrac
            Rossiani Wijaya Rossiani Wijaya
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.