function ViewsEntitySchemaSubscriberIntegrationTest::getUpdatedViewAndDisplay

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

Gets a view and its display.

Parameters

bool $revision: (optional) TRUE if we want to get a revision view.

Return value

array An array with the view as first item, and the display as second.

2 calls to ViewsEntitySchemaSubscriberIntegrationTest::getUpdatedViewAndDisplay()
ViewsEntitySchemaSubscriberIntegrationTest::testVariousTableUpdates in core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
Tests a bunch possible entity definition table updates.
ViewsEntitySchemaSubscriberIntegrationTest::testVariousTableUpdatesForRevisionView in core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
Tests some possible entity table updates for a revision view.

File

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

Class

ViewsEntitySchemaSubscriberIntegrationTest
Tests <a href="/api/drupal/core%21modules%21views%21src%21EventSubscriber%21ViewsEntitySchemaSubscriber.php/class/ViewsEntitySchemaSubscriber/11.x" title="Reacts to changes on entity types to update all views entities." class="local">\Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber</a>.

Namespace

Drupal\Tests\views\Kernel\EventSubscriber

Code

protected function getUpdatedViewAndDisplay($revision = FALSE) {
    $entity_storage = $this->entityTypeManager
        ->getStorage('view');
    
    /** @var \Drupal\views\Entity\View $view */
    $view = $entity_storage->load($revision ? 'test_view_entity_test_revision' : 'test_view_entity_test');
    $display = $view->getDisplay('default');
    return [
        $view,
        $display,
    ];
}

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