You are here

protected function UpgradePathTestCase::uninstallModulesExcept in Drupal 7

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 modules/simpletest/tests/upgrade/update.aggregator.test
Overrides DrupalWebTestCase::setUp() for upgrade testing.
CommentUpgradePathTestCase::setUp in modules/simpletest/tests/upgrade/upgrade.comment.test
Overrides DrupalWebTestCase::setUp() for upgrade testing.
FieldUpdatePathTestCase::setUp in modules/simpletest/tests/upgrade/update.field.test
Overrides DrupalWebTestCase::setUp() for upgrade testing.
ForumUpgradePathTestCase::setUp in modules/simpletest/tests/upgrade/upgrade.forum.test
Overrides DrupalWebTestCase::setUp() for upgrade testing.
LocaleUpgradePathTestCase::setUp in modules/simpletest/tests/upgrade/upgrade.locale.test
Overrides DrupalWebTestCase::setUp() for upgrade testing.

... See full list

File

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