function DisplayTest::testGetAttachedDisplays

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Functional/Plugin/DisplayTest.php \Drupal\Tests\views\Functional\Plugin\DisplayTest::testGetAttachedDisplays()
  2. 8.9.x core/modules/views/tests/src/Functional/Plugin/DisplayTest.php \Drupal\Tests\views\Functional\Plugin\DisplayTest::testGetAttachedDisplays()
  3. 11.x core/modules/views/tests/src/Functional/Plugin/DisplayTest.php \Drupal\Tests\views\Functional\Plugin\DisplayTest::testGetAttachedDisplays()

Tests the getAttachedDisplays method.

File

core/modules/views/tests/src/Functional/Plugin/DisplayTest.php, line 181

Class

DisplayTest
Tests the basic display plugin.

Namespace

Drupal\Tests\views\Functional\Plugin

Code

public function testGetAttachedDisplays() : void {
  $view = Views::getView('test_get_attach_displays');
  // Both the feed_1 and the feed_2 display are attached to the page display.
  $view->setDisplay('page_1');
  $this->assertEquals([
    'feed_1',
    'feed_2',
  ], $view->display_handler
    ->getAttachedDisplays());
  $view->setDisplay('feed_1');
  $this->assertEquals([], $view->display_handler
    ->getAttachedDisplays());
}

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