You are here

protected function FieldDefinitionIntegrityTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/field/src/Tests/FieldDefinitionIntegrityTest.php \Drupal\field\Tests\FieldDefinitionIntegrityTest::setUp()

Performs setup tasks before each individual test method is run.

Overrides KernelTestBase::setUp

File

core/modules/field/src/Tests/FieldDefinitionIntegrityTest.php, line 23
Contains \Drupal\field\Tests\FieldDefinitionIntegrityTest.

Class

FieldDefinitionIntegrityTest
Tests the integrity of field API plugin definitions.

Namespace

Drupal\field\Tests

Code

protected function setUp() {
  parent::setUp();

  // Enable all core modules that provide field plugins.
  $modules = system_rebuild_module_data();
  $modules = array_filter($modules, function (Extension $module) {

    // Filter contrib, hidden, already enabled modules and modules in the
    // Testing package.
    if ($module->origin === 'core' && empty($module->info['hidden']) && $module->status == FALSE && $module->info['package'] !== 'Testing' && is_readable($module
      ->getPath() . '/src/Plugin/Field')) {
      return TRUE;
    }
    return FALSE;
  });
  $this
    ->enableModules(array_keys($modules));
}