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.