You are here

protected function ViewsEntitySchemaSubscriberIntegrationTest::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php \Drupal\Tests\views\Kernel\EventSubscriber\ViewsEntitySchemaSubscriberIntegrationTest::setUp()
  2. 9 core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php \Drupal\Tests\views\Kernel\EventSubscriber\ViewsEntitySchemaSubscriberIntegrationTest::setUp()

File

core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php, line 74

Class

ViewsEntitySchemaSubscriberIntegrationTest
Tests \Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber.

Namespace

Drupal\Tests\views\Kernel\EventSubscriber

Code

protected function setUp($import_test_views = TRUE) : void {
  parent::setUp();
  $this->eventDispatcher = $this->container
    ->get('event_dispatcher');
  $this->eventSubscriber = $this->container
    ->get('views.entity_schema_subscriber');
  $this->entityDefinitionUpdateManager = $this->container
    ->get('entity.definition_update_manager');
  $this->entityTypeManager = $this->container
    ->get('entity_type.manager');
  $this->state = $this->container
    ->get('state');

  // Install every entity type's schema that wasn't installed in the parent
  // method.
  foreach (array_diff_key($this->entityTypeManager
    ->getDefinitions(), array_flip([
    'user',
    'entity_test',
  ])) as $entity_type_id => $entity_type) {
    $this
      ->installEntitySchema($entity_type_id);
  }
}