1 upgrade.test protected UpgradePathTestCase::uninstallModulesExcept(array $modules)

Force uninstall all modules from a test database, except those listed.

Parameters

$modules: The list of modules to keep installed. Required core modules will always be kept.

File

core/modules/simpletest/tests/upgrade/upgrade.test, line 247

Class

UpgradePathTestCase
Perform end-to-end tests of the upgrade path.

Code

protected function uninstallModulesExcept(array $modules) {
  $required_modules = array('block', 'dblog', 'filter', 'node', 'system', 'update', 'user');

  $modules = array_merge($required_modules, $modules);

  db_delete('system')
    ->condition('type', 'module')
    ->condition('name', $modules, 'NOT IN')
    ->execute();
}