You are here

protected function FieldTypePluginManagerTest::enableAllCoreModules in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/field/tests/src/Kernel/FieldTypePluginManagerTest.php \Drupal\Tests\field\Kernel\FieldTypePluginManagerTest::enableAllCoreModules()

Enable all core modules.

1 call to FieldTypePluginManagerTest::enableAllCoreModules()
FieldTypePluginManagerTest::testMainProperty in core/modules/field/tests/src/Kernel/FieldTypePluginManagerTest.php
Tests all field items provide an existing main property.

File

core/modules/field/tests/src/Kernel/FieldTypePluginManagerTest.php, line 117

Class

FieldTypePluginManagerTest
Tests the field type manager.

Namespace

Drupal\Tests\field\Kernel

Code

protected function enableAllCoreModules() {
  $listing = new ExtensionDiscovery($this->root);
  $module_list = $listing
    ->scan('module', FALSE);

  /** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */
  $module_handler = $this->container
    ->get('module_handler');
  $module_list = array_filter(array_keys($module_list), function ($module) use ($module_handler, $module_list) {
    return !$module_handler
      ->moduleExists($module) && substr($module_list[$module]
      ->getPath(), 0, 4) === 'core';
  });
  $this
    ->enableModules($module_list);
}