function MigrationProvidersExistTest::enableAllModules

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php \Drupal\Tests\migrate\Kernel\Plugin\MigrationProvidersExistTest::enableAllModules()
  2. 8.9.x core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php \Drupal\Tests\migrate\Kernel\Plugin\MigrationProvidersExistTest::enableAllModules()
  3. 11.x core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php \Drupal\Tests\migrate\Kernel\Plugin\MigrationProvidersExistTest::enableAllModules()

Enable all available modules.

2 calls to MigrationProvidersExistTest::enableAllModules()
MigrationProvidersExistTest::testFieldProvidersExist in core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php
Tests that modules exist for all field plugins.
MigrationProvidersExistTest::testProvidersExist in core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php
Tests that modules exist for all source plugins.

File

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

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.