function DrupalUnitTestBaseTest::testEnableModulesInstallMultiple

Tests installing of multiple modules via enableModules().

Regression test: Each passed module has to be enabled and installed on its own, in the same way as module_enable() enables only one module after the other.

File

drupal/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php, line 117
Contains Drupal\simpletest\Tests\DrupalUnitTestBaseTest.

Class

DrupalUnitTestBaseTest
Tests DrupalUnitTestBase functionality.

Namespace

Drupal\simpletest\Tests

Code

function testEnableModulesInstallMultiple() {

  // Field retrieves entity type plugins, and EntityTypeManager calls into
  // hook_entity_info_alter(). If both modules would be first enabled together
  // instead of each on its own, then Node module's alter implementation
  // would be called and this simply blows up. To further complicate matters,
  // additionally install Comment module, whose entity bundles depend on node
  // types.
  $this
    ->enableModules(array(
    'field',
    'node',
    'comment',
  ));
  $this
    ->pass('Comment module was installed.');
}