You are here

protected function ValidateMigrationStateTestTrait::enableAllModules in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/migrate_drupal/tests/src/Traits/ValidateMigrationStateTestTrait.php \Drupal\Tests\migrate_drupal\Traits\ValidateMigrationStateTestTrait::enableAllModules()
  2. 9 core/modules/migrate_drupal/tests/src/Traits/ValidateMigrationStateTestTrait.php \Drupal\Tests\migrate_drupal\Traits\ValidateMigrationStateTestTrait::enableAllModules()

Enable all available modules.

File

core/modules/migrate_drupal/tests/src/Traits/ValidateMigrationStateTestTrait.php, line 146

Class

ValidateMigrationStateTestTrait
Tests the migration state information in module.migrate_drupal.yml.

Namespace

Drupal\Tests\migrate_drupal\Traits

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);
  return $modules;
}