protected function UpgradePathTestCase::uninstallModulesExcept

7.x 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.

11 calls to UpgradePathTestCase::uninstallModulesExcept()
AggregatorUpdatePathTestCase::setUp in drupal/modules/simpletest/tests/upgrade/update.aggregator.test
Overrides DrupalWebTestCase::setUp() for upgrade testing.
CommentUpgradePathTestCase::setUp in drupal/modules/simpletest/tests/upgrade/upgrade.comment.test
Overrides DrupalWebTestCase::setUp() for upgrade testing.
FieldUpdatePathTestCase::setUp in drupal/modules/simpletest/tests/upgrade/update.field.test
Overrides DrupalWebTestCase::setUp() for upgrade testing.
ForumUpgradePathTestCase::setUp in drupal/modules/simpletest/tests/upgrade/upgrade.forum.test
Overrides DrupalWebTestCase::setUp() for upgrade testing.
LocaleUpgradePathTestCase::setUp in drupal/modules/simpletest/tests/upgrade/upgrade.locale.test
Overrides DrupalWebTestCase::setUp() for upgrade testing.

... See full list

File

drupal/modules/simpletest/tests/upgrade/upgrade.test, line 295

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();
}