You are here

function KernelTestBaseTest::testEnableModulesInstallContainer in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/src/Tests/KernelTestBaseTest.php \Drupal\simpletest\Tests\KernelTestBaseTest::testEnableModulesInstallContainer()

Tests installing modules with DependencyInjection services.

File

core/modules/simpletest/src/Tests/KernelTestBaseTest.php, line 139
Contains \Drupal\simpletest\Tests\KernelTestBaseTest.

Class

KernelTestBaseTest
Tests KernelTestBase functionality.

Namespace

Drupal\simpletest\Tests

Code

function testEnableModulesInstallContainer() {

  // Install Node module.
  $this
    ->enableModules(array(
    'user',
    'field',
    'node',
  ));
  $this
    ->installEntitySchema('node', array(
    '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.');
}