You are here

protected function ViewsEntitySchemaSubscriberIntegrationTest::setUp in Zircon Profile 8

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

Parameters

bool $import_test_views: Should the views specififed on the test class be imported. If you need to setup some additional stuff, like fields, you need to call false and then call createTestViews for your own.

Overrides ViewKernelTestBase::setUp

File

core/modules/views/src/Tests/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php, line 74
Contains \Drupal\views\Tests\EventSubscriber\ViewsEntitySchemaSubscriberIntegrationTest.

Class

ViewsEntitySchemaSubscriberIntegrationTest
Tests \Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber

Namespace

Drupal\views\Tests\EventSubscriber

Code

protected function setUp() {
  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->entityManager = $this->container
    ->get('entity.manager');
  $this->state = $this->container
    ->get('state');
  $this->database = $this->container
    ->get('database');

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