function DrupalUnitTestBaseTest::testEnableModulesInstallContainer

Tests installing modules via enableModules() with DepedencyInjection services.

File

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

Class

DrupalUnitTestBaseTest
Tests DrupalUnitTestBase functionality.

Namespace

Drupal\simpletest\Tests

Code

function testEnableModulesInstallContainer() {

  // Install Node module.
  // @todo field_sql_storage and field should technically not be necessary
  //   for an entity query.
  $this
    ->enableModules(array(
    'field_sql_storage',
    'field',
    'node',
  ));

  // Perform an entity query against node.
  $query = entity_query('node');

  // Disable node access checks, since User module is not enabled.
  $query
    ->accessCheck(FALSE);
  $query
    ->condition('nid', 1);
  $query
    ->execute();
  $this
    ->pass('Entity field query was executed.');
}