function MigrationProvidersExistTest::enableAllModules

Same name and namespace in other branches
  1. 11.x core/modules/migrate_drupal/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php \Drupal\Tests\migrate_drupal\Kernel\Plugin\MigrationProvidersExistTest::enableAllModules()
  2. 10 core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php \Drupal\Tests\migrate\Kernel\Plugin\MigrationProvidersExistTest::enableAllModules()

Enable all available modules.

File

core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php, line 49

Class

MigrationProvidersExistTest
Tests that modules exist for all source and destination plugins.

Namespace

Drupal\Tests\migrate\Kernel\Plugin

Code

protected function enableAllModules() {
  // Install all available modules.
  $module_handler = $this->container
    ->get('module_handler');
  $modules = $this->coreModuleListDataProvider();
  $modules_enabled = $module_handler->getModuleList();
  $modules_to_enable = array_keys(array_diff_key($modules, $modules_enabled));
  $this->enableModules($modules_to_enable);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.