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

Authentication methods do not test for events

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Minor
    • Resolution: Won't Do
    • 2.9
    • None
    • Authentication, Unit tests
    • MOODLE_29_STABLE

    Description

      As part of MDL-49022 I've been looking at implementing a unit test to ensure that the correct events are called when certain methods are triggered.

      It seems that there are no such unit tests on any authentication modules which might explain why missing event triggers are slipping through the net.

      Would it be worth implementing some standard event tests on all authentication modules which check for events being triggered on method calls:
      .

      • $auth->user_signup() should trigger core\event\user_created
      • $auth->user_update() should trigger core\event\user_updated
      • $auth->user_delete() should trigger core\event\user_deleted

      Clearly there will still need to be bespoke tests implemented for the non-standard methods (for example sync_users() in auth_ldap), however these would be a good starter.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              markdw Mark Ward
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: