Moodle
  1. Moodle
  2. MDL-30210

Fix the broken web service unit tests

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.1.4, 2.2
    • Fix Version/s: STABLE backlog
    • Component/s: Web Services
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
    • Rank:
      26464

      Description

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

        Issue Links

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: