Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-29934 Web service API Roadmap
  3. MDL-37100

core_calendar_get_calendar_events()

    XMLWordPrintable

Details

    • MOODLE_25_STABLE
    • MOODLE_25_STABLE
    • MDL-37100-master
    • Hide
      1. This is moderately difficult test, requires fair bit of time testing various logic flow paths.
      2. Run unit tests and make sure all is good
      3. Make sure the new calendar units tests are executed with the phpunit run. Check phpunit.xml and make sure there is an entry for calendar.
      4. Setup a ws client of your choice. (/moodle/admin/settings.php?section=webservicesoverview might help)
      5. User from now on refer's to an non-admin/managerial single user.
      6. create 6 calendar events (1 site, 1 course with 2 childern(using repeat in new event form), 1 group event, 1 user event)
      7. Goto event table in database using database browser of your choice and note the ids of each of them.
      8. Lets say the ids are 1, 2-3-4,5,6 respectively
      9. Assign a user the permission to make ws calls
      10. Make a call with params like this (Assuming your are using xmlrpc client) :-

                $events = array ('eventids' => array($siteevent->id), 'courseids' => array($course->id), 'groupids' => array($group->id));
                $options = array ('siteevents' => true, 'userevents' => true);
        

      11. Make sure only site event and user event is returned as, the user doesnot have permissions on other events.
      12. Make sure you get warnings for rest
      13. Enrol the user in the course and group
      14. Make call again with the same params and make sure you get 4 events (user, site, course, and group- one each)
      15. Change options to where time() represents the time the events where created and weeksecs is the number of secs in a week. Alternatively browse the database and find out the timestamp for the second course event that was created and use any timestamp greater than that.

                $options = array ('siteevents' => true, 'userevents' => true, 'timeend' => time() + 7*WEEKSECS);
        

      16. Make sure 5 events are returned (site, group, user -one each and 2 course events)
      17. This is how you can pass params in xml-rpc client

        $post = xmlrpc_encode_request($functionname, array( $events, $options));
        

      Show
      This is moderately difficult test, requires fair bit of time testing various logic flow paths. Run unit tests and make sure all is good Make sure the new calendar units tests are executed with the phpunit run. Check phpunit.xml and make sure there is an entry for calendar. Setup a ws client of your choice. (/moodle/admin/settings.php?section=webservicesoverview might help) User from now on refer's to an non-admin/managerial single user. create 6 calendar events (1 site, 1 course with 2 childern(using repeat in new event form), 1 group event, 1 user event) Goto event table in database using database browser of your choice and note the ids of each of them. Lets say the ids are 1, 2-3-4,5,6 respectively Assign a user the permission to make ws calls Make a call with params like this (Assuming your are using xmlrpc client) :- $events = array ('eventids' => array($siteevent->id), 'courseids' => array($course->id), 'groupids' => array($group->id)); $options = array ('siteevents' => true, 'userevents' => true); Make sure only site event and user event is returned as, the user doesnot have permissions on other events. Make sure you get warnings for rest Enrol the user in the course and group Make call again with the same params and make sure you get 4 events (user, site, course, and group- one each) Change options to where time() represents the time the events where created and weeksecs is the number of secs in a week. Alternatively browse the database and find out the timestamp for the second course event that was created and use any timestamp greater than that. $options = array ('siteevents' => true, 'userevents' => true, 'timeend' => time() + 7*WEEKSECS); Make sure 5 events are returned (site, group, user -one each and 2 course events) This is how you can pass params in xml-rpc client $post = xmlrpc_encode_request($functionname, array( $events, $options));

    Description

      Implement core_calendar_delete_calendar_events()

      Attachments

        Issue Links

          Activity

            People

              ankit_frenz Ankit Agarwal
              ankit_frenz Ankit Agarwal
              Jérôme Mouneyrac Jérôme Mouneyrac
              Aparup Banerjee Aparup Banerjee
              Aparup Banerjee Aparup Banerjee
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                14/May/13