MDL-81456 core: Use DI for all hook access
Using DI for all hook access means that it becomes significantly easier to mock hooks and callbacks for unit testing without fundamentally altering the structure of the code purely for the purposes of unit testing.
This commit is contained in:
@@ -130,7 +130,7 @@ class user_bulk_action_form extends moodleform {
|
||||
}
|
||||
|
||||
// Any plugin can append user bulk actions to this list by implementing a hook callback.
|
||||
\core\hook\manager::get_instance()->dispatch($hook);
|
||||
\core\di::get(\core\hook\manager::class)->dispatch($hook);
|
||||
|
||||
// This method may be called from 'Bulk actions' and 'Browse user list' pages. Some actions
|
||||
// may be irrelevant in one of the contexts and they can be excluded by specifying the
|
||||
|
||||
Reference in New Issue
Block a user