You are here

public function KernelTestBaseTest::testEnableModulesInstallContainer in SimpleTest 8.3

Tests installing modules with DependencyInjection services.

File

src/Tests/KernelTestBaseTest.php, line 137

Class

KernelTestBaseTest
Tests KernelTestBase functionality.

Namespace

Drupal\simpletest\Tests

Code

public function testEnableModulesInstallContainer() {

  // Install Node module.
  $this
    ->enableModules([
    'user',
    'field',
    'node',
  ]);
  $this
    ->installEntitySchema('node', [
    'node',
    'node_field_data',
  ]);

  // Perform an entity query against node.
  $query = \Drupal::entityQuery('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.');
}