function SqlTest::setupEntityTypeManager

Sets up the entity type manager in the container.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

1 call to SqlTest::setupEntityTypeManager()
SqlTest::setupEntityTypes in core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php
Sets up some test entity types and corresponding views data.

File

core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php, line 145

Class

SqlTest
Tests Drupal\views\Plugin\views\query\Sql.

Namespace

Drupal\Tests\views\Unit\Plugin\query

Code

protected function setupEntityTypeManager(EntityTypeManagerInterface $entity_type_manager) : void {
  $container = \Drupal::hasContainer() ? \Drupal::getContainer() : new ContainerBuilder();
  $container->set('entity_type.manager', $entity_type_manager);
  \Drupal::setContainer($container);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.