function KernelTestBaseTest::testEnableModulesInstallContainer
Tests installing modules with DependencyInjection services.
File
-
core/
modules/ simpletest/ src/ Tests/ KernelTestBaseTest.php, line 137
Class
- KernelTestBaseTest
- Tests KernelTestBase functionality.
Namespace
Drupal\simpletest\TestsCode
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.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.