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

core_enrol_get_course_enrolment_methods() webservice

    XMLWordPrintable

Details

    • MOODLE_25_STABLE
    • MOODLE_26_STABLE
    • wip-mdl-40126
    • Hide

      Test 1

      1. run phpunit enrol/self/tests/externallib_test.php
      2. run phpunit enrol/tests/externallib_test.php

      Test 2

      1. Create course with:
        • Self enrolment method without password
        • self enrolment method with password
        • self enrolment method which is disabled.
      2. Enable web services (Site administration ► Advanced features)
      3. Enable rest protocol (Site administration ► Plugins ► Web services ► Manage protocols)
      4. Add external service (Site administration ► Plugins ► Web services ► External services)
      5. Add following functions to above service (Site administration ► Plugins ► Web services ► External services ► Functions)
        • core_enrol_get_course_enrolment_methods
        • enrol_self_get_instance_info
      6. Create token for user which will be used in webservice client (Site administration ► Plugins ► Web services ► Manage tokens)
      7. With core_enrol_get_course_enrolment_methods webservice make sure you get information about two self-enrolment methods (which are enabled)
        • First one (without password) should return wsfunction value null
        • Second one (with password) should contain wsfunction = enrol_self_get_instance_info
      8. Passing instanceid of self_enrolment instance to enrol_self_get_instance_info should return
        • For instance without password it should have 'enrolpassword' value as null
        • For instance with (wsfunction) with password, you should see 'enrolpassword' = 'Enrolment key'
        • If you pass instanceid of disabled self-enrolment then it should have status='Enrolment is disabled or inactive'
      Show
      Test 1 run phpunit enrol/self/tests/externallib_test.php run phpunit enrol/tests/externallib_test.php Test 2 Create course with: Self enrolment method without password self enrolment method with password self enrolment method which is disabled. Enable web services (Site administration ► Advanced features) Enable rest protocol (Site administration ► Plugins ► Web services ► Manage protocols) Add external service (Site administration ► Plugins ► Web services ► External services) Add following functions to above service (Site administration ► Plugins ► Web services ► External services ► Functions) core_enrol_get_course_enrolment_methods enrol_self_get_instance_info Create token for user which will be used in webservice client (Site administration ► Plugins ► Web services ► Manage tokens) With core_enrol_get_course_enrolment_methods webservice make sure you get information about two self-enrolment methods (which are enabled) First one (without password) should return wsfunction value null Second one (with password) should contain wsfunction = enrol_self_get_instance_info Passing instanceid of self_enrolment instance to enrol_self_get_instance_info should return For instance without password it should have 'enrolpassword' value as null For instance with (wsfunction) with password, you should see 'enrolpassword' = 'Enrolment key' If you pass instanceid of disabled self-enrolment then it should have status='Enrolment is disabled or inactive'
    • 8
    • BACKEND Sprint 3

    Description

      Create core_enrol_get_course_enrolment_methods() webservice to get list of enrolment plugins in core.

      Follow http://docs.moodle.org/dev/How_to_contribute_a_web_service_function_to_core

      Attachments

        Issue Links

          Activity

            People

              rajeshtaneja Rajesh Taneja
              rajeshtaneja Rajesh Taneja
              Dan Poltawski Dan Poltawski
              Marina Glancy Marina Glancy
              David Monllaó David Monllaó
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

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