MDL-80072 core: Add \core\di wrapper to php-di
The \core\di class is a Moodle wrapper to php-di which is intended to allow Moodle to switch to an alternate DI solution in the future if required. All interaction with the container uses the PSR-11 Container interfaces, which allows for normalisation of configuration, setting, and retrieving of DI container-identified classes.
This commit is contained in:
@@ -300,6 +300,9 @@ class phpunit_util extends testing_util {
|
||||
// Reset user agent.
|
||||
core_useragent::instance(true, null);
|
||||
|
||||
// Reset the DI container.
|
||||
\core\di::reset_container();
|
||||
|
||||
// verify db writes just in case something goes wrong in reset
|
||||
if (self::$lastdbwrites != $DB->perf_get_writes()) {
|
||||
error_log('Unexpected DB writes in phpunit_util::reset_all_data()');
|
||||
|
||||
Reference in New Issue
Block a user