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

Authentication methods do not test for events

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.9
    • Fix Version/s: None
    • Component/s: Authentication, Unit tests
    • Labels:
    • Affected Branches:
      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

              • Assignee:
                Unassigned
                Reporter:
                markdw Mark Ward
                Participants:
                Component watchers:
                Jake Dallimore, Jun Pataleta, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: