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:
@@ -262,6 +262,7 @@ if (PHPUNIT_UTIL) {
|
||||
|
||||
// Make sure the hook manager gets initialised before anybody tries to override callbacks,
|
||||
// this is not using caches intentionally to help with development.
|
||||
// Note: We cannot use DI at this point in the bootstrap either.
|
||||
\core\hook\manager::get_instance();
|
||||
|
||||
// Is database and dataroot ready for testing?
|
||||
|
||||
Reference in New Issue
Block a user