You are here

public function ViewsEntitySchemaSubscriberIntegrationTest::testRevisionEnabling in Drupal 8

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

Tests that enabling revisions doesn't do anything.

File

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

Class

ViewsEntitySchemaSubscriberIntegrationTest
Tests \Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber

Namespace

Drupal\Tests\views\Kernel\EventSubscriber

Code

public function testRevisionEnabling() {
  $this
    ->updateEntityTypeToRevisionable(TRUE);

  /** @var \Drupal\views\Entity\View $view */
  $entity_storage = $this->entityTypeManager
    ->getStorage('view');
  $view = $entity_storage
    ->load('test_view_entity_test');

  // Ensure that nothing happens.
  $this
    ->assertEqual('entity_test_update', $view
    ->get('base_table'));
  $display = $view
    ->getDisplay('default');
  $this
    ->assertEqual('entity_test_update', $display['display_options']['fields']['id']['table']);
  $this
    ->assertEqual('entity_test_update', $display['display_options']['fields']['name']['table']);

  // Check that only the impacted views have been updated.
  $this
    ->assertUpdatedViews([]);
}