$this->
assertEquals(['help', 'config', 'dblog'
],
$module_order);
// Uninstall all three modules explicitly, but in the incorrect order,
// and make sure that ModuleInstaller::uninstall() uninstalled them in the
// correct sequence.
$result =
$this->
moduleInstaller()->
uninstall(['config', 'help', 'dblog'
]);
$this->
assertTrue($result, 'ModuleInstaller::uninstall() returned TRUE.'
);
/** @var \Drupal\Core\Update\UpdateHookRegistry $update_registry */
$update_registry = \Drupal::
service('update.update_hook_registry'
);
foreach (['dblog', 'config', 'help'
] as $module) { $this->
assertEquals($update_registry::SCHEMA_UNINSTALLED,
$update_registry->
getInstalledVersion($module), "{
$module} module was uninstalled."
);
} $uninstalled_modules = \Drupal::
state()->
get('module_test.uninstall_order',
[]);
$this->
assertEquals(['dblog', 'config', 'help'
],
$uninstalled_modules, 'Modules were uninstalled in the correct order.'
);
// Enable dblog module again, which should enable both the Config module and
// Help module. But, this time do it with Config module declaring a
// dependency on a specific version of Help module in its info file. Make
// sure that Drupal\Core\Extension\ModuleInstaller::install() still works.
\Drupal::
state()->
set('module_test.dependency', 'version dependency'
);
$result =
$this->
moduleInstaller()->
install(['dblog'
]);