function ViewsEntitySchemaSubscriberIntegrationTest::testRevisionDisabling

Same name 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()
  3. 11.x 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',
    ]);
}

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