You are here

public function ViewsEntitySchemaSubscriberIntegrationTest::testRevisionDisabling 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::testRevisionDisabling()
  2. 10 core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php \Drupal\Tests\views\Kernel\EventSubscriber\ViewsEntitySchemaSubscriberIntegrationTest::testRevisionDisabling()

Tests that removing revision support disables the view.

File

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

Class

ViewsEntitySchemaSubscriberIntegrationTest
Tests \Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber

Namespace

Drupal\Tests\views\Kernel\EventSubscriber

Code

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

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

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