function ViewsEntitySchemaSubscriberIntegrationTest::getUpdatedViewAndDisplay

Same name in other branches
  1. 9 core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php \Drupal\Tests\views\Kernel\EventSubscriber\ViewsEntitySchemaSubscriberIntegrationTest::getUpdatedViewAndDisplay()
  2. 10 core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php \Drupal\Tests\views\Kernel\EventSubscriber\ViewsEntitySchemaSubscriberIntegrationTest::getUpdatedViewAndDisplay()
  3. 11.x 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 537

Class

ViewsEntitySchemaSubscriberIntegrationTest
Tests \Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber

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.