diff -u b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php --- b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php @@ -102,12 +102,12 @@ $this->kernel = new DrupalKernel('unit_testing', drupal_classloader(), FALSE); $this->kernel->boot(); - // Create a minimal system.module configuration file so that the list of + // Create a minimal system.module configuration object so that the list of // enabled modules can be maintained allowing - // \Drupal\Core\Config\ConfigInstaller::installDefaultConfig() to work. Not - // using configuration factory ensures that events registered by modules - // during self::enableModules are registered. - \Drupal::service('config.cachedstorage.storage')->write('system.module', array('enabled' => array())); + // \Drupal\Core\Config\ConfigInstaller::installDefaultConfig() to work. + // Write directly to active storage to avoid early instantiation of + // the event dispatcher which can prevent modules from registering events. + \Drupal::service('config.storage')->write('system.module', array('enabled' => array())); // Collect and set a fixed module list. $class = get_class($this); @@ -276,8 +276,8 @@ $module_handler = $this->container->get('module_handler'); $module_filenames = $module_handler->getModuleList(); // Write directly to active storage to avoid early instantiation of - // services which can prevent modules from registering events. - $active_storage = \Drupal::service('config.cachedstorage.storage'); + // the event dispatcher which can prevent modules from registering events. + $active_storage = \Drupal::service('config.storage'); $system_config = $active_storage->read('system.module'); foreach ($modules as $module) { $module_filenames[$module] = drupal_get_filename('module', $module);