You are here

protected function ValidateMigrationStateTestTrait::enableAllModules in Drupal 9

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. 10 core/modules/migrate_drupal/tests/src/Traits/ValidateMigrationStateTestTrait.php \Drupal\Tests\migrate_drupal\Traits\ValidateMigrationStateTestTrait::enableAllModules()

Enable all available modules.

1 call to ValidateMigrationStateTestTrait::enableAllModules()
ValidateMigrationStateTestTrait::testMigrationState in core/modules/migrate_drupal/tests/src/Traits/ValidateMigrationStateTestTrait.php
Tests the migration information in .migrate_drupal.yml.

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